Skip to content

Stop coalescing queued writes on reconnect (#928) - #1651

Merged
currentbits merged 2 commits into
mainfrom
coder/reconnect-coalescing-drops-repeated-writ-8d0a75
Oct 16, 2026
Merged

currentbits merged 2 commits into
mainfrom
coder/reconnect-coalescing-drops-repeated-writ-8d0a75

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Fixes #928.

Problem

flushQueue in src/wireClient.ts merged every offline-queued request by [channel, args], mutations included. An offline settings.set true → false → true reached the host as true → false (final value false), while all three callers resolved successfully.

Fix

  • Only allowlisted read methods (list*, get, status, summaries, search, recent) share a reply on reconnect.
  • Every other request is sent in queue order, and it resets the merge window so a read queued after a write never borrows a pre-write reply.
  • Queue cap (64) and per-invoke timeout unchanged.

Test

New case in test/wireClient.test.ts queues poll, poll, set(true), set(false), set(true), poll offline and asserts the exact wire order plus which reply each caller receives. It fails on the old flushQueue and passes now (15/15 in the file).

The full renderer suite and typecheck weren't run cleanly locally: the worktree's node_modules are missing highlight.js/mermaid/xterm. CI is the real check there.

Risk

The allowlist is name-based: a future mutating method named get/status/list… would be coalesced. A read missing from the list only costs one extra request.

🤖 Generated with Claude Code

flushQueue merged every queued request by [channel, args], so an offline
settings.set true/false/true reached the host as true/false while all
three callers resolved. Only allowlisted reads (list*, get, status,
summaries, search, recent) now share a reply, and any other request
resets the merge window so a read queued after a write never borrows a
pre-write reply.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T07:59:13.502163Z cb49040 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@currentbits
currentbits merged commit fe0b452 into main Oct 16, 2026
6 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.

Reconnect coalescing drops repeated writes and acknowledges changes the host never applied

1 participant