Skip to content

Add userClaim field across chat entities#193

Draft
AndyTWF wants to merge 1 commit into
mainfrom
user-claims
Draft

Add userClaim field across chat entities#193
AndyTWF wants to merge 1 commit into
mainfrom
user-claims

Conversation

@AndyTWF

@AndyTWF AndyTWF commented Feb 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add server-provided userClaim (JWT claim) field to Message, RoomReaction, MessageReaction, TypingSetEvent.Change, and PresenceMember interfaces
  • Extract userClaim from realtime message/annotation extras for Messages, RoomReactions, and MessageReactions
  • Parse userClaim from REST API responses for Messages
  • Cache userClaim across typing heartbeats and preserve in timed-stop events
  • Define userClaim API on PresenceMember (always null pending ably-java PresenceMessage.extras support)
  • Add MessageExtras?.userClaim() helper for safe extraction from extras JSON

Spec: CHA-M2h, CHA-MR7d, CHA-ER2a, CHA-PR6g, CHA-T13a1

Ref: ably/specification#423, ably/ably-chat-js#711

Test plan

  • Unit tests for userClaim parsing from realtime message extras (present, absent, non-string)
  • Unit tests for userClaim parsing from REST API responses
  • Unit tests for userClaim extraction from room reaction extras
  • Unit tests for userClaim extraction from annotation extras in raw message reaction events
  • Unit tests for userClaim in typing start/stop events, heartbeat preservation, timed-stop, and precedence logic
  • ./gradlew check passes (detekt + all tests + lint)
  • API compatibility baseline updated via ./gradlew apiDump

🤖 Generated with Claude Code

Add server-provided userClaim (JWT claim) support to Message, RoomReaction,
MessageReaction, TypingSetEvent.Change, and PresenceMember interfaces.

For Messages, RoomReactions, and MessageReactions, userClaim is extracted
from realtime message/annotation extras. For Messages it is also parsed
from REST API responses. For Typing, userClaim is cached across heartbeats
and preserved in timed-stop events. Presence defines the API contract but
leaves it null pending ably-java PresenceMessage.extras support.

Spec: CHA-M2h, CHA-MR7d, CHA-ER2a, CHA-PR6g, CHA-T13a1

[CHA-1243]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Feb 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch user-claims

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant