Skip to content

fix(messages): allow guard-to-guard chat#311

Open
LoopyB wants to merge 1 commit intomainfrom
louisabest/fix-guard-to-guard-messaging
Open

fix(messages): allow guard-to-guard chat#311
LoopyB wants to merge 1 commit intomainfrom
louisabest/fix-guard-to-guard-messaging

Conversation

@LoopyB
Copy link
Copy Markdown
Collaborator

@LoopyB LoopyB commented Apr 27, 2026

Summary

Fixed guard-to-guard messaging in the backend.

Previously, sendMessage only allowed guard-to-employer and employer-to-guard communication, which caused guard-to-guard chat to be rejected with a 403 error.

Changes

  • Updated message role validation to allow:
    • guard → guard
    • guard → employer
    • employer → guard
  • Kept employer → employer and admin-involved messaging blocked
  • Updated the Swagger messaging tag description to match the new allowed communication paths
  • Added a focused regression test for message role validation

Validation

Passed:

npm test -- --runInBand message.controller.test.js
Screenshot 2026-04-27 144359 Screenshot 2026-04-27 144910

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant