Skip to content

Commit 535eaee

Browse files
lawrence-forooghianclaude
authored andcommitted
Specify that Subscription#unsubscribe is idempotent
Adds SUB2b clarifying that repeated calls to `Subscription#unsubscribe` are a no-op, matching the ably-js implementation across all three subscription factories (LiveObject EventEmitter.off, the PathObjectSubscriptionRegister Map.delete, and Instance which delegates to LiveObject). Lifted from Sachin's spec-alignment PR [1]. [1] #480 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 037de99 commit 535eaee

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

specifications/features.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,6 +1877,7 @@ The core SDK provides an API for wrapper SDKs to supply Ably with analytics info
18771877
- `(SUB1)` A `Subscription` represents a registration for receiving events from a subscribe operation
18781878
- `(SUB2)` The `Subscription` object has the following method:
18791879
- `(SUB2a)` `unsubscribe` - deregisters the listener that was registered by the corresponding `subscribe` call. Once `unsubscribe` is called, the listener must not be called for any subsequent events
1880+
- `(SUB2b)` Calling `unsubscribe` more than once is a no-op
18801881

18811882
### Option types {#options}
18821883

0 commit comments

Comments
 (0)