Skip to content

fix: stop mutating OperationRepo deltaQueue during flush#1693

Open
nan-li wants to merge 1 commit into
mainfrom
nan/fix-flush-delta-queue-iteration
Open

fix: stop mutating OperationRepo deltaQueue during flush#1693
nan-li wants to merge 1 commit into
mainfrom
nan/fix-flush-delta-queue-iteration

Conversation

@nan-li

@nan-li nan-li commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes OSOperationRepo.flushDeltaQueue mutating deltaQueue while iterating it (for-in + remove(at:)), which is undefined behavior and can crash or skip deltas.
  • Rebuilds the queue as the list of unmatched deltas instead (same keep-until-executor-available semantics).

Stability review live-risk #1; Phase 0 concurrency patch track (non-JWT).

Test plan

  • Existing UserConcurrencyTests.testOperationRepoFlushingConcurrency still relevant (run with Full plan).
  • Spot-check: deltas with known executors leave the repo queue; unknown names stay queued.

Made with Cursor

Rebuilding the unmatched list avoids for-in + remove(at:) on the same
array, which could crash or skip deltas.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant