Skip to content

Conversation

@SuperGamer001
Copy link
Member

My PR for CPW 207 Assignment 2: CRC Cards

Copilot AI review requested due to automatic review settings January 27, 2026 23:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds CRC (Class-Responsibility-Collaborator) cards documentation for Assignment 2 of CPW-207. The document defines four classes involved in a messaging/chat system: Conversation, InterWebSocket, Message, and Notification (Inbox), along with their responsibilities and collaborators.

Changes:

  • Added new CRC cards documentation file defining the design of a messaging system with four main classes and their interactions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +11 to +14
- InterWebSocket


## InterWebSocket
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The class name "InterWebSocket" doesn't match the actual implementation in the codebase. The codebase uses the standard "WebSocket" from the 'ws' library (see server.js line 8). Consider renaming this to "WebSocket" or "WebSocketHandler" to align with the actual implementation.

Suggested change
- InterWebSocket
## InterWebSocket
- WebSocket
## WebSocket

Copilot uses AI. Check for mistakes.

**Responsibilities**
- Updates users in real time when a message, letter, invite, etc. shows up.
- Updates player info in Online Multiplayer Games.
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The responsibility "Updates player info in Online Multiplayer Games" appears to be out of scope for a WebSocket handler in a messaging/chat system. The actual WebSocket implementation in server.js focuses on handling chat messages, typing indicators, and read status updates (see lines 65-122 in server.js). Consider removing this responsibility or clarifying how it relates to the messaging system.

Suggested change
- Updates player info in Online Multiplayer Games.
- Handles real-time chat events such as typing indicators and read status updates.

Copilot uses AI. Check for mistakes.
**Collaborators**
- User
- Conversation
- Notification (Inbox)
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The collaborator "Notification (Inbox)" references a class that doesn't have its own CRC card defined in this document. However, the codebase has a "Mail" table (DatabaseSetup.js lines 60-70) that appears to serve this purpose. Consider either adding a CRC card for Mail/Notification or removing this collaborator reference if it's not part of the messaging system being documented.

Copilot uses AI. Check for mistakes.

**Responsibilities**
- Holds and receives messages sent by participants
- Keeps together replied messages and attachments
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The responsibility "Keeps together replied messages and attachments" is ambiguous. Based on the database schema (DatabaseSetup.js lines 94-109), the ConversationData table stores messages with Reply references and Attachment fields. Consider rephrasing this to be more specific, such as "Maintains relationship between messages and their replies" or "Organizes message threads and attachments".

Suggested change
- Keeps together replied messages and attachments
- Maintains relationships between messages, their replies, and attachments

Copilot uses AI. Check for mistakes.
**Responsibilities**
- Holds and receives messages sent by participants
- Keeps together replied messages and attachments
- Informs users on which message the user last read.
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The responsibility "Informs users on which message the user last read" is handled by a separate ConversationReadStatus table in the database (DatabaseSetup.js lines 111-124), not directly by the Conversation entity. Consider either moving this responsibility to a separate CRC card for read status tracking, or rephrasing it to indicate that Conversation coordinates with read status tracking rather than directly informing users.

Suggested change
- Informs users on which message the user last read.
- Coordinates with read status tracking to determine which message each user last read.

Copilot uses AI. Check for mistakes.
**Collaborators**
- User
- Conversation
- Friend No newline at end of file
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

"Friend" is listed as a collaborator but there is no corresponding CRC card for the Friend class in this document. The codebase has a Friends table (DatabaseSetup.js lines 72-81) and friend-related functionality. Consider adding a CRC card for the Friend class or explaining why it's referenced as a collaborator without its own card.

Suggested change
- Friend
- Friend
## Friend
**Responsibilities**
- Represents a friendship relationship between users
- Stores friendship status and metadata (for example, when the friendship was created)
- Supports friend-related actions such as sending and responding to friend requests
**Collaborators**
- User
- Notification (Inbox)
- Conversation

Copilot uses AI. Check for mistakes.
**Responsibilities**
- Contains information about what's in the message
- Tracks who sent it and when
- Holds possible rewards that can be obtained
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The responsibility "Holds possible rewards that can be obtained" doesn't align with the Mail table implementation (DatabaseSetup.js lines 60-70), which has a "PackageContent" field but no specific "rewards" field. The codebase doesn't show any reward-handling logic in the mail/notification system. Consider clarifying this responsibility or verifying if rewards are actually part of the notification system design.

Suggested change
- Holds possible rewards that can be obtained
- Holds any associated package content or additional data

Copilot uses AI. Check for mistakes.
Comment on lines +11 to +14
- InterWebSocket


## InterWebSocket
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The collaborator reference "InterWebSocket" should be updated to match the corrected naming convention. As noted in line 14, the actual implementation uses "WebSocket", not "InterWebSocket".

Suggested change
- InterWebSocket
## InterWebSocket
- WebSocket
## WebSocket

Copilot uses AI. Check for mistakes.
@SuperGamer001 SuperGamer001 added the assignment Issue/PR is for a school assignment label Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

assignment Issue/PR is for a school assignment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants