Skip to content

Commit e1adbc0

Browse files
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 9858d2f commit e1adbc0

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
@@ -1875,6 +1875,7 @@ The core SDK provides an API for wrapper SDKs to supply Ably with analytics info
18751875
- `(SUB1)` A `Subscription` represents a registration for receiving events from a subscribe operation
18761876
- `(SUB2)` The `Subscription` object has the following method:
18771877
- `(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
1878+
- `(SUB2b)` Calling `unsubscribe` more than once is a no-op
18781879

18791880
### Option types {#options}
18801881

0 commit comments

Comments
 (0)