Skip to content

ui-react: local-work-runtime's outgoing-snapshot case saves the newer words unbound when the file runs shuffled #3901

Open

Description

@schlessera

Context

The test-health baseline for packages/ui-react/tests/local-work-runtime.test.ts gave verdict order-dependent: 2 of 2 shuffled runs failed and 2 of 2 in-order runs passed. Run th-20261110182050-6072af, cluster 2, bun scripts/test-health.ts measure … --runs 2 --shuffle --together, at 0129244ad plus test-only commits that do not touch this file. Bun 1.4.2, real Chrome.

Only this case fails, both times with the same message:

draft reconciliation kept on this device (#1214) > on a host that keeps outgoing snapshots, words typed while the first message is out wait for its acceptance, then save under its session (packages/ui-react/tests/local-work-runtime.test.ts:852-890)

the newer words are that session's draft
  [
-   "odysseus-ithaca",
+   null,
  ]

The newer words reached the host unbound (sessionId: null) instead of under the session the released message created. The case's last wait is settle() (local-work-runtime.test.ts:735-738). That poll returns silently when its condition never holds, so the failure surfaces on the assertion after it. The other nine cases passed in every order. The together run (the cluster's three runtime files in one process) passed.

Whether the cause is state another case leaves on the shared host or page (one host and one origin for the whole file, startHost, local-work-runtime.test.ts:83-107), or a product race that the order exposes, is not established.

Scope

Identify which preceding case, or which shared state, makes this case save the newer words unbound. Then make the case independent of order, or file the product defect if the save really goes out unbound.

Out of scope

Raising timeouts or the settle bound, adding retries or skips, and splitting the file into separate processes to hide the order.

Acceptance criteria

  • The cause is named with evidence: the preceding case or shared state, and a reproduction with a fixed --seed.
  • bun scripts/test-health.ts measure packages/ui-react/tests/local-work-runtime.test.ts --runs 5 --shuffle reports no failure. Alternatively, a type: fix issue is filed for a product race, and this case is left asserting the correct behaviour.

Verification

bun run test ./packages/ui-react/tests/local-work-runtime.test.ts --randomize --seed=<seed> with the failing seed, before and after.

Contract impact

None expected.

Triage 2026-11-10 (main 91e54be37): repaired the case and settle ranges, which moved by two lines under #3772; startHost still holds at 83-107. The recorded shuffled baseline (2 of 2 failed, in-order 2 of 2 passed) is the reproduction evidence; no new run was made in triage.

Activity

  1. added
    type: testCoverage, harness or proof work with no behaviour change.
    area: ui-reactReact chat/files/voice components, stores, WebSocket transport.
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    on Nov 10, 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

    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-reactReact chat/files/voice components, stores, WebSocket transport.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: testCoverage, harness or proof work with no behaviour change.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions