Skip to content

[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
mainfrom
DX-1211/strict-mode-granted-mode-checks
Open

[DX-1211] Add strictMode client option and granted-mode checks on subscribe and presence.get#505
umair-ably wants to merge 1 commit into
mainfrom
DX-1211/strict-mode-granted-mode-checks

Conversation

@umair-ably

@umair-ably umair-ably commented Jul 14, 2026

Copy link
Copy Markdown

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#subscribe without SUBSCRIBE (new RTL7i) and RealtimePresence#get without PRESENCE_SUBSCRIBE (new RTP11f). Adds a strictMode client option (TO3r) that selects between failing the operation (true) and the legacy silent result plus an ERROR-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 [] and subscribe() 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 presence mode (the server NACKs those, so they are not silent); the ErrorInfo remediation/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 — so strictMode gating is not necessary there to preserve existing behaviour.

Reference implementation: ably/ably-js#2236.

🤖 Generated with Claude Code

… 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>
@umair-ably umair-ably requested a review from AndyTWF July 14, 2026 14:58
@umair-ably umair-ably marked this pull request as ready for review July 14, 2026 14:59
@umair-ably umair-ably changed the title Add strictMode client option and granted-mode checks on subscribe and presence.get [DX-1211] Add strictMode client option and granted-mode checks on subscribe and presence.get Jul 14, 2026
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