Clarify clearTimeserial must be reset when LiveMap is reset#486
Open
lawrence-forooghian wants to merge 1 commit into
Open
Clarify clearTimeserial must be reset when LiveMap is reset#486lawrence-forooghian wants to merge 1 commit into
clearTimeserial must be reset when LiveMap is reset#486lawrence-forooghian wants to merge 1 commit into
Conversation
When resetting an existing LiveMap's data you are meant to also reset its clearTimeserial (as JS / Swift / Kotlin implementations all do). This was never very clear in the spec and 4cec279 made it even less clear. So, define an explicit "reset data for an existing LiveObject" procedure and defer to it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
paddybyers
reviewed
Jun 1, 2026
| - `(RTLC4)` A new empty `LiveCounter` can be created with the following values: | ||
| - `(RTLC4a)` `objectId` is passed into the constructor and set upon creation | ||
| - `(RTLC4b)` `data` is set to 0 | ||
| - `(RTLC17)` The data of a `LiveCounter` can be reset to that of a new empty `LiveCounter` as follows: |
Member
There was a problem hiding this comment.
I don't think reset of a LiveCounter is a thing
Collaborator
Author
There was a problem hiding this comment.
The spec already (i.e. pre-this-PR) resets a LiveCounter's data as part of the RTLO4e tombstone procedure
Member
There was a problem hiding this comment.
ok, why? Unlike a map, there's no space saving if you reset a LiveCounter. Is it just for consistency then?
Collaborator
Author
There was a problem hiding this comment.
I'm not sure to be honest — it's what ably-js does. Possible reasons would be consistency or a design decision that if a user has a reference to a deleted LiveCounter then when they call value() on it it should return 0, but I'm just speculating.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When resetting an existing
LiveMap's data you are meant to also reset itsclearTimeserial(as JS / Swift / Kotlin implementations all do). This was never very clear in the spec and 4cec279 made it even less clear. So, define an explicit "reset data for an existingLiveObject" procedure and defer to it.