Skip to content

London | 26-SDC-MAR | Craig D'Silva | Sprint 2 | Chat App#87

Open
craig-dsilva wants to merge 38 commits into
CodeYourFuture:mainfrom
craig-dsilva:chat-app
Open

London | 26-SDC-MAR | Craig D'Silva | Sprint 2 | Chat App#87
craig-dsilva wants to merge 38 commits into
CodeYourFuture:mainfrom
craig-dsilva:chat-app

Conversation

@craig-dsilva
Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

This is the coursework for the Chat App.

@craig-dsilva craig-dsilva added the 🏕 Priority Mandatory This work is expected label May 29, 2026
@craig-dsilva craig-dsilva added 🐋 Size X-Large 8-16 hours 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Decomposition The name of the module. labels May 29, 2026
@craig-dsilva
Copy link
Copy Markdown
Author

@cjyuan
Copy link
Copy Markdown

cjyuan commented Jun 5, 2026

The spec has this requirement:

It must also support at least one additional feature.

The Changelist section of the PR description would be the best place to include this info.

Also, why not include the frontend and backend links in the PR description? Make it easier to find everything in one place.

@cjyuan cjyuan added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jun 5, 2026
Copy link
Copy Markdown

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The code is well-structured and highly modular. Nice work. 👍

  • The deployed frontend appears to be unavailable and returns a "Bad Gateway" error, so I wasn't able to test the application.

  • Input validation and error handling could be strengthened. The current implementation has limited safeguards against invalid input and unexpected failures.

  • Code could use some documentation (comments).

    A useful rule of thumb is to ask yourself whether you could still explain or figure out how the code works few months from now. If the answer is uncertain, consider adding a comment to help future readers understand the intent and reasoning behind it.

Comment on lines +2 to +5
const dt = new Date(messageTime);
const date = new Intl.DateTimeFormat("en-GB").format(new Date(dt));
const time = new Date(messageTime).toTimeString().split(" ")[0];
return { date, time };
Copy link
Copy Markdown

@cjyuan cjyuan Jun 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the user is from a country in a different time zone?

Comment on lines +19 to +21
key={i}
i={i}
index={message.index}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems some of these props are not in used.

Could you think of a better prop name than i?

}, [url]);

const sendMessage = async (text) => {
const msg = { text, time: new Date().toISOString(), likes: 0, dislikes: 0 };
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you investigate why using client-side timestamps in a chat app may lead to issues?

Comment on lines +5 to +6
const cursorRef = useRef(0);
const activeRef = useRef(true);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these constants for?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the long polling implementation, how does a user get the latest messages from the server during an active conversation?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Decomposition The name of the module. 🏕 Priority Mandatory This work is expected Reviewed Volunteer to add when completing a review with trainee action still to take. 🐋 Size X-Large 8-16 hours 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants