Skip to content

Add userClaim field support across chat entities#423

Open
AndyTWF wants to merge 1 commit intomainfrom
claude/spec-changes-pr-711-nibOR
Open

Add userClaim field support across chat entities#423
AndyTWF wants to merge 1 commit intomainfrom
claude/spec-changes-pr-711-nibOR

Conversation

@AndyTWF
Copy link
Contributor

@AndyTWF AndyTWF commented Feb 12, 2026

Summary

This change adds support for an optional userClaim field across multiple chat entities (Messages, Reactions, Presence Members, and Typing Events). The userClaim field is a server-provided string extracted from JWT claims embedded in realtime message extras, enabling better user identification and authentication tracking in chat operations.

CHA-1243

Key Changes

  • Messages: Added userClaim field to Message objects with specification requirements that it is read-only, server-provided, and extracted from JWT claims in realtime message extras or REST API responses.

  • Message Reactions: Added userClaim field support to both raw message reaction events (MessageReactionRawEvent) and ephemeral room reactions (Reaction), with the same read-only, server-provided semantics.

  • Presence Members: Added userClaim field to PresenceMember objects and presence events, extracted from the underlying Ably realtime presence message extras.

  • Typing Events: Added userClaim field to typing event changes with an additional requirement that the claim must be preserved across heartbeat events and inactivity timeouts for a given clientId.

Implementation Details

  • All userClaim fields are marked as optional and read-only
  • Clients cannot send userClaim when publishing messages, reactions, or entering presence
  • The field is consistently extracted from extras.userClaim in the underlying Ably realtime messages
  • For REST API responses, the field is extracted from response data if present
  • All changes include corresponding testable specification points (CHA-M2h, CHA-MR7a1, CHA-ER2a, CHA-PR6a1, CHA-T13a1)
  • Updated data structure examples in the specification to show the new optional field

https://claude.ai/code/session_018wsKegy1oEvaaKuc8kD16V

@AndyTWF AndyTWF marked this pull request as draft February 12, 2026 14:55
@AndyTWF AndyTWF force-pushed the claude/spec-changes-pr-711-nibOR branch from 20d46b7 to 8795d4c Compare February 12, 2026 15:02
Add optional userClaim field to chat specification for:
- Message V4 structure
- MessageReactionRawEvent
- RoomReaction (Ephemeral)
- PresenceMember
- TypingEvent V3

The userClaim field is server-provided from JWT claims embedded in
realtime message extras. It is read-only and cannot be sent by clients.

Specification points added:
- CHA-M2h: userClaim in Message
- CHA-MR7a1: userClaim in MessageReactionRawEvent
- CHA-ER2a: userClaim in RoomReaction
- CHA-PR6a1: userClaim in PresenceMember
- CHA-T13a1: userClaim in TypingEvent

Related to: ably/ably-chat-js#711

https://claude.ai/code/session_018wsKegy1oEvaaKuc8kD16V
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.

3 participants