Skip to content

Commit a3a5292

Browse files
Remove unsubscribe(listener) from LiveObject/PathObject/Instance
`Subscription` (returned by `subscribe`) is now the sole deregistration mechanism, matching the ably-js public API. RTLO4c is retained as a "This clause has been deleted" stub since it existed on main; RTPO20 and RTINS17 are removed outright as they were introduced earlier in this PR branch. The corresponding `unsubscribe` declarations are also removed from the IDL. Lifted from Sachin's spec-alignment PR [1]. [1] #480 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fade83e commit a3a5292

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

specifications/objects-features.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,11 @@ Objects feature enables clients to store shared data as "objects" on a channel.
343343
- `(RTLO4b5b)` This clause has been replaced by [RTLO4b7](#RTLO4b7)
344344
- `(RTLO4b7)` Returns a [`Subscription`](../features#SUB1) object
345345
- `(RTLO4b6)` This operation must not have any side effects on `RealtimeObject`, the underlying channel, or their status
346-
- `(RTLO4c)` `unsubscribe` - unsubscribes a previously registered listener
347-
- `(RTLO4c1)` This operation does not require any specific channel modes to be granted, nor does it require the channel to be in a specific state
348-
- `(RTLO4c2)` A user may provide a listener they wish to deregister from receiving data updates for this `LiveObject`
349-
- `(RTLO4c3)` Once deregistered, subsequent data updates for this `LiveObject` must not result in the listener being called
350-
- `(RTLO4c4)` This operation must not have any side effects on `RealtimeObject`, the underlying channel, or their status
346+
- `(RTLO4c)` This clause has been deleted
347+
- `(RTLO4c1)` This clause has been deleted
348+
- `(RTLO4c2)` This clause has been deleted
349+
- `(RTLO4c3)` This clause has been deleted
350+
- `(RTLO4c4)` This clause has been deleted
351351
- `(RTLO4a)` protected `canApplyOperation` - a convenience method used to determine whether the `ObjectMessage.operation` should be applied to this object based on a serial value
352352
- `(RTLO4a1)` Expects the following arguments:
353353
- `(RTLO4a1a)` `ObjectMessage`
@@ -933,9 +933,6 @@ A `PathObject` is obtained from `RealtimeObject#get` ([RTO23](#RTO23)), which re
933933
- `(RTPO19d2)` `message` `PublicAPI::ObjectMessage` (optional) - if `LiveObjectUpdate.objectMessage` from the [RTLO4b4](#RTLO4b4) emission that triggered this event is populated and its `operation` field is populated, a `PublicAPI::ObjectMessage` ([PAOM1](#PAOM1)) derived from it per [PAOM3](#PAOM3); otherwise omitted
934934
- `(RTPO19e)` Adds a subscription to the `RealtimeObject`'s `PathObjectSubscriptionRegister` ([RTO24](#RTO24)) with subscribed path equal to this `PathObject`'s `path` (per [RTPO2a](#RTPO2a)), the provided `listener`, and the provided `options.depth`
935935
- `(RTPO19f)` This operation must not have any side effects on `RealtimeObject`, the underlying channel, or their status
936-
- `(RTPO20)` `PathObject#unsubscribe` function:
937-
- `(RTPO20a)` Accepts a `listener` argument and deregisters it from receiving further events for this `PathObject`'s path
938-
- `(RTPO20b)` This operation must not have any side effects on `RealtimeObject`, the underlying channel, or their status
939936

940937
### Instance
941938

@@ -1005,9 +1002,6 @@ An `Instance` holds a direct reference to a specific resolved `LiveObject` or pr
10051002
- `(RTINS16e)` Returns a [`Subscription`](../features#SUB1) object
10061003
- `(RTINS16f)` The subscription is identity-based: it follows the specific `LiveObject` instance, regardless of where it sits in the tree
10071004
- `(RTINS16g)` This operation must not have any side effects on `RealtimeObject`, the underlying channel, or their status
1008-
- `(RTINS17)` `Instance#unsubscribe` function:
1009-
- `(RTINS17a)` Accepts a `listener` argument and deregisters it from receiving further events using `LiveObject#unsubscribe` ([RTLO4c](#RTLO4c))
1010-
- `(RTINS17b)` This operation must not have any side effects on `RealtimeObject`, the underlying channel, or their status
10111005

10121006
### PublicAPI::ObjectMessage
10131007

@@ -1089,7 +1083,6 @@ Types and their properties/methods are public and exposed to users by default. A
10891083
canApplyOperation(ObjectMessage) -> Boolean // RTLO4a
10901084
tombstone(ObjectMessage) // RTLO4e
10911085
subscribe((LiveObjectUpdate) ->) -> Subscription // RTLO4b
1092-
unsubscribe((LiveObjectUpdate) ->) // RTLO4c
10931086

10941087
interface LiveObjectUpdate: // RTLO4b4, internal
10951088
update: Object // RTLO4b4a
@@ -1174,7 +1167,6 @@ Types and their properties/methods are public and exposed to users by default. A
11741167
increment(Number amount?) => io // RTPO17
11751168
decrement(Number amount?) => io // RTPO18
11761169
subscribe((PathObjectSubscriptionEvent) -> listener, PathObjectSubscriptionOptions? options) -> Subscription // RTPO19
1177-
unsubscribe((PathObjectSubscriptionEvent) -> listener) // RTPO20
11781170

11791171
class Instance: // RTINS*
11801172
id: String? // RTINS3
@@ -1191,4 +1183,3 @@ Types and their properties/methods are public and exposed to users by default. A
11911183
increment(Number amount?) => io // RTINS14
11921184
decrement(Number amount?) => io // RTINS15
11931185
subscribe((InstanceSubscriptionEvent) -> listener) -> Subscription // RTINS16
1194-
unsubscribe((InstanceSubscriptionEvent) -> listener) // RTINS17

0 commit comments

Comments
 (0)