Commit 69ae754
Centralise PathObject/Instance access checks in RTO25/RTO26
Move the OBJECT_SUBSCRIBE mode + channel-state check (access API
preconditions) and the OBJECT_PUBLISH mode + channel-state +
echoMessages check (write API preconditions) out of the
LiveMap/LiveCounter/LiveObject public methods and into two new
common clauses (RTO25 and RTO26). Each PathObject and Instance
public method that accesses or mutates data now references the
applicable preconditions and renumbers its sub-clauses so the
check sits in a logical position (after Expects, before any data
work). External cross-references to the renumbered sub-clauses,
including the IDL section, are updated.
Two motivations:
1. Previously the spec placed these checks on LiveMap/LiveCounter,
which delegating PathObject/Instance methods triggered only
after path resolution and type checks. A call against a stale
or detached channel could then yield a "wrong type" result
(empty array etc.) instead of a state error. ably-js already
moved the checks to the public entry points for this reason
(commit a7462b14, "Handle channel configuration checks on
PathObject/Instance level instead of LiveMap/LiveCounter").
2. With the checks lifted out, the underlying LiveMap/LiveCounter
methods become non-throwing for channel-state reasons. This
matters for internal callers that invoke them in a non-throwing
context, e.g. RTO5c10b iterating LiveMap#entries during the
post-sync parentReferences rebuild. See [1].
The displaced LiveMap/LiveCounter/LiveObject sub-clauses are kept
as "replaced by RTO25/RTO26" markers rather than deleted.
[1] #477 (comment)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent de3574f commit 69ae754
1 file changed
Lines changed: 149 additions & 116 deletions
0 commit comments