Skip to content

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

Closed

Description

@currentbits

Priority: P1. Reproduced at commit 6c7a6fbe on 2026-09-05.

In the web client, queued writes are deduplicated like polling reads. An offline true → false → true settings sequence reaches the host as only true → false, while all three callers resolve successfully.

Reproduction

  1. Authenticate createWireCoder against a fake socket, then disconnect.
  2. Invoke settings.set({notifications:true}), settings.set({notifications:false}), settings.set({notifications:true}) while offline.
  3. Reconnect and acknowledge the outgoing requests.
  4. Only two settings:set requests were sent; the final host value is false. The three promises return true, false, true.

Cause

src/wireClient.ts:65 flushQueue groups every request by JSON.stringify([channel,args]), including mutations. The last true write borrows the first write's reply despite an intervening false write. This affects mutation semantics, not just visual refresh.

Acceptance

  • Preserve every queued mutation and its order, including repeated arguments separated by another write.
  • Restrict coalescing to explicitly safe read requests; retain bounded queues/timeouts.
  • Cover true/false/true writes and repeated safe polling in one transport regression test.

Related closed #130 introduced reconnect coalescing to reduce polling stampedes. This is a distinct correctness defect in that behavior.
Source: wireClient.ts.

Runnable audit evidence

Local artifact: docs/issue-drafts/2026-09-05-recovery-reproduce.mjs.

node --import=./test/support/disable-grok-mcp.mjs --import=./test/support/render.mjs --experimental-strip-types docs/issue-drafts/2026-09-05-recovery-reproduce.mjs

Exited 0 with six CONFIRMED assertions. This is an audit harness asserting existing defects, not passing regression tests for fixes. The artifact is in the audit checkout, not yet committed; the steps above stand alone.

Requested disposition: separate Planboard issue, plan:todo.

Activity

  1. added
    plan:todo
    on Sep 5, 2026
  2. added
    plan:doing
    and removed
    plan:todo
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    plan:doing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions