Skip to content

Implement a couple of recent spec-clarity changes#133

Open
lawrence-forooghian wants to merge 2 commits into
mainfrom
2026-06-01-implement-spec-tweaks
Open

Implement a couple of recent spec-clarity changes#133
lawrence-forooghian wants to merge 2 commits into
mainfrom
2026-06-01-implement-spec-tweaks

Conversation

@lawrence-forooghian
Copy link
Copy Markdown
Collaborator

@lawrence-forooghian lawrence-forooghian commented Jun 1, 2026

Update to reflect the following spec PRs:

Summary by CodeRabbit

Release Notes

  • Improvements
    • Updated initialization and reset behavior for empty Live Objects (maps and counters) to ensure more consistent state management across operations
    • Enhanced handling of tombstoned and deleted objects with improved cleanup semantics and state recovery
    • Refined object lifecycle management during synchronization and reattachment scenarios to ensure proper creation and cleanup of empty objects in all cases

lawrence-forooghian and others added 2 commits June 1, 2026 11:12
Per spec commit 4cec279 and WIP 7279de8 (the latter from [1]).

[1] ably/specification#486

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per spec commit 1fcfd28.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 761863d8-0066-4045-9b37-b9f2f62e8d41

📥 Commits

Reviewing files that changed from the base of the PR and between ace39c1 and ca976db.

📒 Files selected for processing (12)
  • Sources/AblyLiveObjects/Internal/InternalDefaultLiveCounter.swift
  • Sources/AblyLiveObjects/Internal/InternalDefaultLiveMap.swift
  • Sources/AblyLiveObjects/Internal/InternalDefaultRealtimeObjects.swift
  • Sources/AblyLiveObjects/Internal/InternalLiveObject.swift
  • Sources/AblyLiveObjects/Internal/ObjectsPool.swift
  • Tests/AblyLiveObjectsTests/Helpers/TestFactories.swift
  • Tests/AblyLiveObjectsTests/InternalDefaultLiveCounterTests.swift
  • Tests/AblyLiveObjectsTests/InternalDefaultLiveMapTests.swift
  • Tests/AblyLiveObjectsTests/InternalDefaultRealtimeObjectsTests.swift
  • Tests/AblyLiveObjectsTests/JS Integration Tests/ObjectsIntegrationTests.swift
  • Tests/AblyLiveObjectsTests/ObjectCreationHelpersTests.swift
  • Tests/AblyLiveObjectsTests/ObjectsPoolTests.swift

Walkthrough

This PR performs a comprehensive terminology migration renaming "zero-valued" to "empty" across the LiveObjects codebase. Factory methods, reset procedures, and test helpers are renamed consistently while preserving functional behavior and refining the tombstone-checking logic in LiveMap.

Changes

Zero-Valued to Empty Terminology Migration

Layer / File(s) Summary
Protocol contract update
Sources/AblyLiveObjects/Internal/InternalLiveObject.swift
Protocol requirement changes from resetDataToZeroValued() to resetDataToEmpty(), and tombstoning invokes the new reset method.
Counter factory and reset methods
Sources/AblyLiveObjects/Internal/InternalDefaultLiveCounter.swift
createZeroValued() renamed to createEmpty() and MutableState.resetDataToZeroValued() renamed to resetDataToEmpty().
Map factory and reset methods
Sources/AblyLiveObjects/Internal/InternalDefaultLiveMap.swift
createZeroValued() renamed to createEmpty() and resetDataToZeroValued() renamed to resetDataToEmpty(), which now explicitly clears both data and clearTimeserial.
Map tombstone logic and pool creation
Sources/AblyLiveObjects/Internal/InternalDefaultLiveMap.swift
nosync_convertEntryToLiveMapValue() now uses nosync_isEntryTombstoned() for comprehensive tombstone detection; MAP_SET switches to createEmptyObject().
Pool factory and sync creation
Sources/AblyLiveObjects/Internal/ObjectsPool.swift
createZeroValueObject() renamed to createEmptyObject(); root map and all object creation paths now use createEmpty() for counters and maps.
RealtimeObjects integration and message handling
Sources/AblyLiveObjects/Internal/InternalDefaultRealtimeObjects.swift
testsOnly_createZeroValueLiveObject() renamed to testsOnly_createEmptyLiveObject(); OBJECT message handling for missing objects now uses createEmptyObject().
Test documentation and helper updates
Tests/AblyLiveObjectsTests/Helpers/TestFactories.swift
Documentation example updated to reference createEmpty().
Counter test suite updates
Tests/AblyLiveObjectsTests/InternalDefaultLiveCounterTests.swift
All counter tests updated to initialize with createEmpty(); assertions and test flows unchanged.
Map test suite updates
Tests/AblyLiveObjectsTests/InternalDefaultLiveMapTests.swift
All map tests updated to initialize with createEmpty() and test expectations adjusted; comments refined to use "new object" and "empty" terminology.
RealtimeObjects test updates
Tests/AblyLiveObjectsTests/InternalDefaultRealtimeObjectsTests.swift
Test helper calls switched to testsOnly_createEmptyLiveObject(); test name and comments updated to reflect "empty" semantics.
Integration and pool test updates
Tests/AblyLiveObjectsTests/JS Integration Tests/ObjectsIntegrationTests.swift, Tests/AblyLiveObjectsTests/ObjectCreationHelpersTests.swift, Tests/AblyLiveObjectsTests/ObjectsPoolTests.swift
Integration tests update comments to use "empty" terminology; pool and creation helper tests exercise createEmptyObject() across synchronization and object creation scenarios.

🎯 3 (Moderate) | ⏱️ ~25 minutes

🐰 A naming quest through the code we go,
From "zero-valued" to "empty"—oh, what a show!
Factories and resets align at last,
With tests that verify the refactoring's passed.
The protocol leads the way so bright,
Ensuring all creation paths are right!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive terms like 'couple of recent spec-clarity changes' that don't convey what was actually changed. Consider a more specific title that describes the main change, such as 'Rename LiveObject creation/reset from zero-valued to empty' or 'Align LiveObject terminology with spec PR #479'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 96.91% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-06-01-implement-spec-tweaks

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant