Skip to content

Stop toasting when the consensus-checklist creation race is lost - #845

Merged
InfinityBowman merged 1 commit into
mainfrom
fix/844-reconcile-race-toasts
Sep 19, 2026
Merged

InfinityBowman merged 1 commit into
mainfrom
fix/844-reconcile-race-toasts

Conversation

@InfinityBowman

@InfinityBowman InfinityBowman commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Closes #844

Problem

Two reviewers opening the same reconciliation at once both create the consensus checklist. The loser's checklist.create is rejected as DuplicateChecklist, which rolls the optimistic row back, so the unconditional follow-up checklist.update (status reconciling, title) is rejected as NotFound. The pool toasted both. The page already adopts the winner through its race-recovery effect, so both toasts were noise and the second was wrong.

Change

  • checklist.create with kind: 'consensus' now creates the row already reconciling and titled "Reconciled Checklist". A consensus checklist only exists to be reconciled, so the follow-up update is gone along with the NotFound rejection.
  • ReconciliationWrapper no longer issues that update after the create.
  • ConnectionPool still logs the rejection but skips the toast for a consensus create rejected as DuplicateChecklist. Reviewer-kind duplicates from the To-Do tab still toast.
  • Shared test asserting a consensus create lands reconciling with the title.

The seed and templates path already sends a checklist.update after creating consensus rows, which remains valid.

Verification

  • pnpm --filter @corates/shared test: 333 passed
  • pnpm --filter web test (localCollections, reconcile): 324 passed
  • pnpm typecheck, pnpm lint: clean

https://claude.ai/code/session_01TAEtViwHmBCJSDSVKkzTD6

Summary by CodeRabbit

  • Bug Fixes
    • Consensus checklists now start directly in reconciliation with the “Reconciled Checklist” title.
    • Prevented a race condition that could trigger duplicate-creation errors during reconciliation.
    • Suppressed misleading error notifications when duplicate consensus creation results from this expected race.
    • Reconciliation progress is now preserved without requiring an immediate follow-up update.

The reconcile page created the consensus checklist and then immediately
updated it to reconciling. When another client had already created it,
the server rejected the create as DuplicateChecklist and the follow-up
update as NotFound, and the pool toasted both while the page silently
adopted the winner.

A consensus checklist is now born reconciling with its title, so there is
no follow-up update to fail, and the pool skips the toast for a consensus
create lost to DuplicateChecklist since the page recovers on its own.

Closes #844

Claude-Session: https://claude.ai/code/session_01TAEtViwHmBCJSDSVKkzTD6
@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 1b5b01cc-e172-4e94-b184-39e0cadeae4a

📥 Commits

Reviewing files that changed from the base of the PR and between 4776e3b and c39688b.

📒 Files selected for processing (4)
  • packages/shared/src/sync/__tests__/checklists.test.ts
  • packages/shared/src/sync/mutators.ts
  • packages/web/src/components/project/reconcile-tab/ReconciliationWrapper.tsx
  • packages/web/src/project/ConnectionPool.ts
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@InfinityBowman
InfinityBowman merged commit 8c3bc69 into main Sep 19, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reconcile: losing the consensus-checklist creation race shows two misleading error toasts

1 participant