Skip to content

Conversation

@VeskeR
Copy link
Contributor

@VeskeR VeskeR commented Jul 11, 2025

Resolves PUB-1827

@VeskeR VeskeR added the live-objects Related to LiveObjects functionality. label Jul 11, 2025
@VeskeR VeskeR force-pushed the PUB-1827/objects-subscriptions branch from 01b4bec to 2963300 Compare July 11, 2025 06:08
@github-actions github-actions bot temporarily deployed to staging/pull/346 July 11, 2025 06:08 Inactive
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 11, 2025
The correct behaviour wasn't clear from the spec when I wrote cb427d8,
but new spec PR [1] makes it seem that this is the right thing to do
(still needs clarifying though).

[1] ably/specification#346
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 11, 2025
TODO test
TODO call listeners on SDK's callback queue

Based on [1] at 2963300. Implementation written by me

[1] ably/specification#346
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
The correct behaviour wasn't clear from the spec when I wrote cb427d8,
but new spec PR [1] makes it seem that this is the right thing to do
(still needs clarifying though).

[1] ably/specification#346
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
Motivation as in 3f6de86; the new spec points in [1] tell us these can
throw.

[1] ably/specification#346
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
Based on [1] at 2963300.

pretty much all done by me, only a bit of dependency injection test
updates were done by cursor

for now don't test replaceData return value since not specified

TODO need to sort out the weird @SPEC(…) that were added in OBJECT_SYNC

Have not implemented RTL04b1's channel mode checking for same reason as
mentioned in 8d881e2.

[1] ably/specification#346
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
Based on [1] at 2963300.

pretty much all done by me, only a bit of dependency injection test
updates were done by cursor

for now don't test replaceData return value since not specified

Have not implemented RTL04b1's channel mode checking for same reason as
mentioned in 8d881e2.

[1] ably/specification#346
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
Based on [1] at 2963300.

Have not implemented RTL04b1's channel mode checking for same reason as
mentioned in 8d881e2.

Have not currently tested `replaceData`'s return value; will do once [2]
clarified.

[1] ably/specification#346
[2] https://github.com/ably/specification/pull/346/files#r2201363446
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
Based on [1] at 2963300.

Have not implemented RTL04b1's channel mode checking for same reason as
mentioned in 8d881e2.

Have not currently tested `replaceData`'s return value; will do once [2]
clarified.

[1] ably/specification#346
[2] https://github.com/ably/specification/pull/346/files#r2201363446
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
Based on [1] at 2963300.

Have not implemented RTL04b1's channel mode checking for same reason as
mentioned in 8d881e2.

Have not currently tested `replaceData`'s return value; will do once [2]
clarified.

[1] ably/specification#346
[2] https://github.com/ably/specification/pull/346/files#r2201363446
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
The correct behaviour wasn't clear from the spec when I wrote cb427d8,
but new spec PR [1] makes it seem that this is the right thing to do
(still needs clarifying though).

[1] ably/specification#346
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
Motivation as in 3f6de86; the new spec points in [1] tell us these can
throw.

[1] ably/specification#346
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
Based on [1] at 2963300.

Have not implemented RTL04b1's channel mode checking for same reason as
mentioned in 8d881e2.

Have not currently tested `replaceData`'s return value; will do once [2]
clarified.

[1] ably/specification#346
[2] https://github.com/ably/specification/pull/346/files#r2201363446
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
The correct behaviour wasn't clear from the spec when I wrote cb427d8,
but new spec PR [1] makes it seem that this is the right thing to do
(still needs clarifying though).

[1] ably/specification#346
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
Motivation as in 3f6de86; the new spec points in [1] tell us these can
throw.

[1] ably/specification#346
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
Based on [1] at 2963300.

Have not implemented RTL04b1's channel mode checking for same reason as
mentioned in 8d881e2.

Have not currently tested `replaceData`'s return value; will do once [2]
clarified.

[1] ably/specification#346
[2] https://github.com/ably/specification/pull/346/files#r2201363446
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
The correct behaviour wasn't clear from the spec when I wrote cb427d8,
but new spec PR [1] makes it seem that this is the right thing to do
(still needs clarifying though).

[1] ably/specification#346
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
Motivation as in 3f6de86; the new spec points in [1] tell us these can
throw.

[1] ably/specification#346
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 16, 2025
Based on [1] at 2963300.

Have not implemented RTL04b1's channel mode checking for same reason as
mentioned in 8d881e2.

Have not currently tested `replaceData`'s return value; will do once [2]
clarified.

[1] ably/specification#346
[2] https://github.com/ably/specification/pull/346/files#r2201363446
unsubscribe((LiveObjectUpdate) ->) // RTLO4c
unsubscribeAll() // RTLO4d

interface LiveObjectSubscription: // RTLO4b5
Copy link
Collaborator

@sacOO7 sacOO7 Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
interface LiveObjectSubscription: // RTLO4b5
interface ObjectsSubscription: // RTLO4b5

Athough, we have a LiveObject class, it's internal and we chose not to use this naming convention right?
I think we can have a common interface that implements unsubscribe for all type of subscribe or on methods

Copy link
Contributor Author

@VeskeR VeskeR Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Athough, we have a LiveObject class, it's internal and we chose not to use this naming convention right?

The LiveObject interface is exposed in ably-js implementation and the naming convention is correct in this case. This is a "live object" - an object whose data is synced in realtime - and its name only coincidentally resembles the name of the LiveObjects feature.
The LiveObjectSubscription in this case represents a subscription for a LiveObject instance, so I think the name should remain as it is.

I think we can have a common interface that implements unsubscribe for all type of subscribe or on methods

The current API uses the subscribe/unsubscribe and on/off naming pairs, so for .on methods the returned object should expose .off() method I think.

lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 23, 2025
The correct behaviour wasn't clear from the spec when I wrote cb427d8,
but new spec PR [1] makes it seem that this is the right thing to do
(still needs clarifying though).

[1] ably/specification#346
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 23, 2025
Motivation as in 3f6de86; the new spec points in [1] tell us these can
throw.

[1] ably/specification#346
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 23, 2025
Based on [1] at 2963300.

Have not implemented RTL04b1's channel mode checking for same reason as
mentioned in 8d881e2.

Have not currently tested `replaceData`'s return value; will do once [2]
clarified.

[1] ably/specification#346
[2] https://github.com/ably/specification/pull/346/files#r2201363446
lawrence-forooghian added a commit to ably/ably-liveobjects-swift-plugin that referenced this pull request Jul 29, 2025
Based on [1] at 2963300.

Have not implemented RTL04b1's channel mode checking for same reason as
mentioned in 8d881e2.

Have not currently tested `replaceData`'s return value; will do once [2]
clarified.

[1] ably/specification#346
[2] https://github.com/ably/specification/pull/346/files#r2201363446
@VeskeR VeskeR force-pushed the objects-features-idl branch from 38a7dfa to 875d7ac Compare September 5, 2025 08:27
@VeskeR VeskeR force-pushed the PUB-1827/objects-subscriptions branch from 2963300 to c63992b Compare September 5, 2025 08:56
Copy link
Collaborator

@sacOO7 sacOO7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@VeskeR VeskeR force-pushed the objects-features-idl branch from 875d7ac to 7ccb26d Compare September 8, 2025 08:30
Base automatically changed from objects-features-idl to main September 8, 2025 08:32
@VeskeR VeskeR force-pushed the PUB-1827/objects-subscriptions branch from c63992b to 46888e4 Compare September 8, 2025 08:33
@VeskeR VeskeR merged commit a255f8e into main Sep 8, 2025
2 checks passed
@VeskeR VeskeR deleted the PUB-1827/objects-subscriptions branch September 8, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

live-objects Related to LiveObjects functionality.

Development

Successfully merging this pull request may close these issues.

3 participants