Skip to content

Clarify the default values for newly created LiveMap and LiveCounter#478

Open
sacOO7 wants to merge 3 commits into
mainfrom
clarify-zero-value-objects-v2
Open

Clarify the default values for newly created LiveMap and LiveCounter#478
sacOO7 wants to merge 3 commits into
mainfrom
clarify-zero-value-objects-v2

Conversation

@sacOO7
Copy link
Copy Markdown
Collaborator

@sacOO7 sacOO7 commented May 19, 2026

@sacOO7
Copy link
Copy Markdown
Collaborator Author

sacOO7 commented May 19, 2026

I had a question

  1. We already have zero-value references in the codebase ( both ably-js and ably-java AFAIK), so do we want to keep existing terminology or adapt to new one?
  2. If we adapt to new one ( default value or a new object ), do we also need to update relevant references in all codebases. If we keep implementation spec-agnostic, then it will differ across SDKs for zero-value objects
  3. Maybe replacing zero-value object with empty object would make more sense?

@sacOO7
Copy link
Copy Markdown
Collaborator Author

sacOO7 commented May 19, 2026

I had a question

  1. We already have zero-value references in the codebase ( both ably-js and ably-java AFAIK), so do we want to keep existing terminology or adapt to new one?
  2. If we adapt to new one ( default value or a new object ), do we also need to update relevant references in all codebases. If we keep implementation spec-agnostic, then it will differ across SDKs for zero-value objects
  3. Maybe replacing zero-value object with empty object would make more sense?

Validated all public facing liveobject docs for zero-value, zero value terminology

We found =>

The "zero-value" terminology is purely a spec-internal artefact that was never surfaced in public-facing documentation. The docs already use the user-friendly phrasings ("empty map", "initial value 0", "newly created object", "initial state") that the spec PR is migrating toward, so the public surface is already coherent with the new wording.

ZERO_VALUE_LIVEOBJECTS_REVIEW.md

@sacOO7
Copy link
Copy Markdown
Collaborator Author

sacOO7 commented May 20, 2026

Updated PR as per discussion here -> 286024e

Comment thread specifications/objects-features.md Outdated
- `(RTO4b)` If the `HAS_OBJECTS` flag is 0 or there is no `flags` field, the sync sequence must be considered complete immediately, and the client library must perform the following actions in order:
- `(RTO4b1)` All objects except the one with id `root` must be removed from the internal `ObjectsPool`
- `(RTO4b2)` The data for the `LiveMap` with id `root` must be cleared by setting it to a zero-value per [RTLM4](#RTLM4). Note that the client SDK must not create a new `LiveMap` instance with id `root`; it must only clear the internal data of the existing `LiveMap` with id `root`
- `(RTO4b2)` The data for the `LiveMap` with id `root` must be cleared by setting it to an empty map per [RTLM4c](#RTLM4c). Note that the client SDK must not create a new `LiveMap` instance with id `root`; it must only clear the internal data of the existing `LiveMap` with id `root`
Copy link
Copy Markdown
Collaborator

@lawrence-forooghian lawrence-forooghian May 20, 2026

Choose a reason for hiding this comment

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

Suggested change
- `(RTO4b2)` The data for the `LiveMap` with id `root` must be cleared by setting it to an empty map per [RTLM4c](#RTLM4c). Note that the client SDK must not create a new `LiveMap` instance with id `root`; it must only clear the internal data of the existing `LiveMap` with id `root`
- `(RTO4b2)` The data for the `LiveMap` with id `root` must be cleared by setting it to the value described in [RTLM4c](#RTLM4c). Note that the client SDK must not create a new `LiveMap` instance with id `root`; it must only clear the internal data of the existing `LiveMap` with id `root`

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We don't really set any value as per RTLM4c. Being explicit, we clear/get rid of all values from the map.
Do you think wording gets misleading here?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

RTLM4c describes a particular value for data (i.e. an empty map); we're saying to set it to that value

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again as mentioned in the other comment we can even lose the word "clear"

Copy link
Copy Markdown
Collaborator Author

@sacOO7 sacOO7 May 20, 2026

Choose a reason for hiding this comment

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

Addressed, removed cleared keyword d0de4ca

Comment thread specifications/objects-features.md Outdated
- `(RTLO4e3b)` This clause has been replaced by [RTLO6b](#RTLO6b)
- `(RTLO4e3b1)` This clause has been replaced by [RTLO6b1](#RTLO6b1)
- `(RTLO4e4)` Set the data for the `LiveObject` to a zero-value, as described in [RTLC4](#RTLC4) or [RTLM4](#RTLM4) depending on the object type
- `(RTLO4e4)` Clear the internal data of the `LiveObject` as described in [RTLC4b](#RTLC4b) or [RTLM4c](#RTLM4c), depending on the object type
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- `(RTLO4e4)` Clear the internal data of the `LiveObject` as described in [RTLC4b](#RTLC4b) or [RTLM4c](#RTLM4c), depending on the object type
- `(RTLO4e4)` Clear the internal data of the `LiveObject` by setting it to the value described in [RTLC4b](#RTLC4b) or [RTLM4c](#RTLM4c), depending on the object type

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We don't really set any value for either LiveMap or LiveCounter, don't you think it's a bit misleading to say setting it to the value wdyt?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What do you mean "we don't really set any value" — isn't this spec point saying that you should set the LiveObject's data property to a specific value?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It could even just lose the word "clear" and say

    - `(RTLO4e4)` Set the `data` attribute of the `LiveObject` to the value described in [RTLC4b](#RTLC4b) or [RTLM4c](#RTLM4c), depending on the object type

Copy link
Copy Markdown
Collaborator Author

@sacOO7 sacOO7 May 20, 2026

Choose a reason for hiding this comment

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

Updated d0de4ca

@lawrence-forooghian
Copy link
Copy Markdown
Collaborator

@sacOO7 just a couple of minor comments, and please could you squash commits before merge?

@github-actions github-actions Bot temporarily deployed to staging/pull/478 May 20, 2026 19:02 Inactive
sacOO7 added 3 commits May 21, 2026 00:32
…in RTLM4 and RTLC4

Also remove the term "zero-value" object as it is an unnecessary detail
that simply describes a newly created object according to RTLM4 and RTLC4
@sacOO7
Copy link
Copy Markdown
Collaborator Author

sacOO7 commented May 20, 2026

@sacOO7 just a couple of minor comments, and please could you squash commits before merge?

Fixed d0de4ca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants