Skip to content

[AIT-318] Remove the createOperationIsMerged flag#2154

Closed
lawrence-forooghian wants to merge 1 commit intomainfrom
AIT-318-remove-createOperationIsMerged
Closed

[AIT-318] Remove the createOperationIsMerged flag#2154
lawrence-forooghian wants to merge 1 commit intomainfrom
AIT-318-remove-createOperationIsMerged

Conversation

@lawrence-forooghian
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian commented Jan 26, 2026

This flag served as an idempotency mechanism from the time when we were applying *_CREATE ops on ACK in createMap() and createCounter(). Since the removal of these methods in 0dc0ce6, we no longer perform these ops locally, so this flag isn't needed.

Discussed in this Slack thread.

Summary by CodeRabbit

  • Refactor
    • Simplified handling of create operations for live objects and maps: initial create operations are always merged and previous special-case skipping logic has been removed, allowing repeated create processing to merge per-entry changes.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 26, 2026

Walkthrough

Removed the _createOperationIsMerged boolean from the LiveObject base class and eliminated its related conditional branches in LiveCounter and LiveMap so CREATE operations are no longer specially gated by that flag.

Changes

Cohort / File(s) Summary
Base class field removal
src/plugins/liveobjects/liveobject.ts
Deleted protected _createOperationIsMerged: boolean; and its constructor initialization.
LiveCounter adjustments
src/plugins/liveobjects/livecounter.ts
Removed assignments to the flag in overrideWithObjectState and _mergeInitialDataFromCreateOperation; deleted the conditional guard in _applyCounterCreate that skipped applying COUNTER_CREATE.
LiveMap adjustments
src/plugins/liveobjects/livemap.ts
Removed flag assignments in the state-override and merge completion paths; deleted the conditional guard in _applyMapCreate that prevented reprocessing MAP_CREATE.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through code, flag tucked away,
CREATE now merges, bright as day.
No more checks to slow the run,
Simpler paths and clearer sun. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main change: removing the createOperationIsMerged flag from the codebase as evidenced by deletions in three files.
Linked Issues check ✅ Passed The PR directly addresses AIT-318 by removing the createOperationIsMerged flag from LiveObject, LiveCounter, and LiveMap classes, fulfilling the stated objective.
Out of Scope Changes check ✅ Passed All changes are narrowly scoped to removing the createOperationIsMerged flag and its associated logic; no unrelated modifications were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch AIT-318-remove-createOperationIsMerged

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.

@lawrence-forooghian lawrence-forooghian changed the title Remove the createOperationIsMerged flag [AIT-318] Remove the createOperationIsMerged flag Jan 26, 2026
@github-actions github-actions bot temporarily deployed to staging/pull/2154/bundle-report January 26, 2026 13:37 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2154/features January 26, 2026 13:37 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2154/typedoc January 26, 2026 13:37 Inactive
@lawrence-forooghian lawrence-forooghian marked this pull request as ready for review January 26, 2026 13:37
This flag served as an idempotency mechanism from the time when we were
applying *_CREATE ops on ACK in createMap() and createCounter(). Since
the removal of these methods in 0dc0ce6, we no longer perform these ops
locally, so this flag isn't needed.

Discussion in [1].

Resolves AIT-318.

[1] https://ably-real-time.slack.com/archives/C09SY1AQGK0/p1769195388456439
@lawrence-forooghian
Copy link
Collaborator Author

Closing since this flag is still needed — see #2156

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