Skip to content

Commit 9858d2f

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 6a5177f commit 9858d2f

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`
@@ -926,9 +926,6 @@ A `PathObject` is obtained from `RealtimeObject#get` ([RTO23](#RTO23)), which re
926926
- `(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
927927
- `(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`
928928
- `(RTPO19f)` This operation must not have any side effects on `RealtimeObject`, the underlying channel, or their status
929-
- `(RTPO20)` `PathObject#unsubscribe` function:
930-
- `(RTPO20a)` Accepts a `listener` argument and deregisters it from receiving further events for this `PathObject`'s path
931-
- `(RTPO20b)` This operation must not have any side effects on `RealtimeObject`, the underlying channel, or their status
932929

933930
### Instance
934931

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

1005999
### PublicAPI::ObjectMessage
10061000

@@ -1082,7 +1076,6 @@ Types and their properties/methods are public and exposed to users by default. A
10821076
canApplyOperation(ObjectMessage) -> Boolean // RTLO4a
10831077
tombstone(ObjectMessage) // RTLO4e
10841078
subscribe((LiveObjectUpdate) ->) -> Subscription // RTLO4b
1085-
unsubscribe((LiveObjectUpdate) ->) // RTLO4c
10861079

10871080
interface LiveObjectUpdate: // RTLO4b4, internal
10881081
update: Object // RTLO4b4a
@@ -1167,7 +1160,6 @@ Types and their properties/methods are public and exposed to users by default. A
11671160
increment(Number amount?) => io // RTPO17
11681161
decrement(Number amount?) => io // RTPO18
11691162
subscribe((PathObjectSubscriptionEvent) -> listener, PathObjectSubscriptionOptions? options) -> Subscription // RTPO19
1170-
unsubscribe((PathObjectSubscriptionEvent) -> listener) // RTPO20
11711163

11721164
class Instance: // RTINS*
11731165
id: String? // RTINS3
@@ -1184,4 +1176,3 @@ Types and their properties/methods are public and exposed to users by default. A
11841176
increment(Number amount?) => io // RTINS14
11851177
decrement(Number amount?) => io // RTINS15
11861178
subscribe((InstanceSubscriptionEvent) -> listener) -> Subscription // RTINS16
1187-
unsubscribe((InstanceSubscriptionEvent) -> listener) // RTINS17

0 commit comments

Comments
 (0)