[DX-1211] Add strictMode client option and granted-mode checks on subscribe and presence.get#505
Open
umair-ably wants to merge 1 commit into
Open
[DX-1211] Add strictMode client option and granted-mode checks on subscribe and presence.get#505umair-ably wants to merge 1 commit into
umair-ably wants to merge 1 commit into
Conversation
… presence.get New spec points TO3r (strictMode ClientOptions attribute), RTL7i (RealtimeChannel#subscribe checks granted modes for SUBSCRIBE) and RTP11f (RealtimePresence#get checks granted modes for PRESENCE_SUBSCRIBE), so that operations whose effect depends on a channel mode the server did not grant fail with an ErrorInfo (strictMode true) or log a warning while preserving their legacy silent result (strictMode false, the default). Reference implementation: ably/ably-js#2236. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
umair-ably
added a commit
to ably/ably-js
that referenced
this pull request
Jul 14, 2026
…roposed spec points Spec point IDs RTL7i1/RTL7i2 and RTP11f1/RTP11f2 are proposed in ably/specification#505 and are provisional until that PR merges. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Author's Note
Extends spec to include new strictMode behaviour as implemented in ably/ably-js#2236. Spec changes highlight whether the error is thrown or logged for previously silent subscribe and presence errors caused by channel mode mismatches.
What: Specifies the behaviour when a client performs an operation whose effect depends on a channel mode the server did not grant:
RealtimeChannel#subscribewithoutSUBSCRIBE(newRTL7i) andRealtimePresence#getwithoutPRESENCE_SUBSCRIBE(newRTP11f). Adds astrictModeclient option (TO3r) that selects between failing the operation (true) and the legacy silent result plus anERROR-level log (false, the default), allowing SDKs to ship the fix additively before a future major version flips the default.Why: Today these calls fail silently —
presence.get()resolves with[]andsubscribe()registers a listener that never fires. This is a significant DX trap for both humans and coding agents (see ably/ably-js#2236 for experiments quantifying agent failure rates: 50% unrecoverable → 0% with strict failures). The checks use the granted mode set (RTL4m), not the requested modes, so they also catch the case where a capability restriction caused the server to silently drop a requested mode.Error codes: 90009 (
subscribe_mode_not_enabled) and 91008 (presence_subscribe_mode_not_enabled) are already registered in ably-common.Deliberately out of scope: presence enter/update/leave without the
presencemode (the server NACKs those, so they are not silent); theErrorInforemediation/hint field ably-js attaches to these errors (naming under separate discussion); and the annotations mode check (RTAN4e), where ably-js already fails the call today — deviating from other SDKs, which log per the current spec text — sostrictModegating is not necessary there to preserve existing behaviour.Reference implementation: ably/ably-js#2236.
🤖 Generated with Claude Code