Skip to content

755 Feature request add senders id to the chat reaction information and update test builders#764

Open
CapoMK25 wants to merge 5 commits intodevfrom
755-feature-request-add-senders-id-to-the-chat-reaction-information
Open

755 Feature request add senders id to the chat reaction information and update test builders#764
CapoMK25 wants to merge 5 commits intodevfrom
755-feature-request-add-senders-id-to-the-chat-reaction-information

Conversation

@CapoMK25
Copy link
Collaborator

Brief description

This PR implements the requirement to include the player's unique ID (sender_id) within chat reactions. This ensures the frontend can reliably identify the author of a reaction, consistent with our ChatMessage ownership model.

Change list

  • Modified Reaction class in reaction.schema.ts to include sender_id as a required String property.
  • Updated ReactionDto and CreateReactionDto to enforce the inclusion of sender_id.
  • Updated ChatService.addReaction() to accept sender_id as a mandatory 4th argument.
  • Refactored BaseChatService and gateways to extract the playerId from the authenticated socket client and pass it through to the service layer.
  • Updated ReactionDtoBuilder and ChatBuilderFactory with default mock IDs to satisfy TypeScript's strict requirements across all existing tests.
  • Updated addReaction.test.ts to verify that sender_id is correctly persisted and returned.
  • Full Pass: All 249 test suites (including global and clan chat) are passing with the new mandatory argument.

@CapoMK25
Copy link
Collaborator Author

We have to go through the transaction support PRs first since they touch the same code, and then we can move on to this.

Copy link
Member

@hoan301298 hoan301298 left a comment

Choose a reason for hiding this comment

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

Looks good to me. But if you can change a bit more, that could be nice.

Copy link
Member

Choose a reason for hiding this comment

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

I suggest to add

setSenderId(id: string) {
    this.base.sender_id = id;
    return this;
}

let chatService: ChatService;
const chatMessageBuilder = ChatBuilderFactory.getBuilder('ChatMessage');
const chatModel = ChatModule.getChatModel();
const mockSenderId = '60f7c2d9a2d3c7b7e56d01df';
Copy link
Member

Choose a reason for hiding this comment

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

This comment is up to you if you want it simple like using the senderId below to pass into addReaction(). This action means the sender also reacting with his message. Or another sender react to it like you did.

@github-project-automation github-project-automation bot moved this from Backlog to Done in Altzone-Server Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants