feat(messaging): add direct messaging backend (conversations, cursor … - #72
Merged
Merged
Conversation
…messages, read state) Adds a production-shaped DM stub: get-or-create conversations by unique fan/creator pair, participant-only authz, cursor-paginated inbox and message lists, idempotent sends (clientId/Idempotency-Key), read receipts, a per-user rate-limit guard, and soft-deleted-user blocking.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #50
Implemented the backend foundation for the Direct Messaging system, introducing secure conversation management, message exchange, cursor-based pagination, read receipts, and essential abuse protection.
What Changed
Added Conversation and Message entities.
Implemented get-or-create conversation flow to ensure unique fan–creator conversations.
Added inbox and message retrieval endpoints with cursor-based pagination.
Implemented message sending with idempotency support (Idempotency-Key/clientId).
Added endpoint to mark messages as read.
Enforced participant authorization to prevent unauthorized access.
Added request validation for message content.
Implemented rate limiting for message sending.
Prevented soft-deleted users from creating new messages.
Documented conversation access behavior to avoid information leakage.
Added comprehensive test coverage for conversation creation, messaging, pagination, read receipts, idempotency, authorization, validation, rate limiting, and authentication.
Impact
This PR delivers a production-ready backend stub for direct messaging, providing a secure and scalable API that supports the frontend messaging experience while establishing the foundation for future real-time messaging features.