Skip to content

ui-react: parallel-sessions runtime "scrolled-up session clears after Scroll to latest" times out intermittently on 390 phone #3377

Closed

Description

@schlessera

Blocked by #3406

Context

packages/ui-react/tests/parallel-sessions-runtime.test.ts failed intermittently in hosted unit (2) (run 41506807539, job 125488962503, head d3c1d874c of #3320). The failing case was "mounted parallel sessions > 390 phone, light, coarse pointer, reduced motion: A and B stream side by side; trackers follow success, failure and a queued follow-up, and clear only once seen".

Where it fails. Session C finishes while the reader has scrolled up. The test then presses "Scroll to latest" (disc, line 697) and waits for C to read as cleared (line 721). The wait goes through until (packages/ui-react/tests/parallel-sessions-runtime.test.ts:274-276), and its 15 s waitForFunction timed out. The probe's last state:

never held: p.views().find((v) => v.sessionId === "odysseus-parallel-3")?.cleared === true
{"views":[{"sessionId":"odysseus-parallel-3","state":"done","pendingKind":null,"cleared":false,"turnId":"3ca268fb-…","settled":true}],"active":"odysseus-parallel-3",…}

C is active, done and settled, but it is never marked seen after the press. The assertion just before it ("scrolled up is not seen", line 719) passed.

Why this looks unrelated to the PR that hit it.

Scope

  • Find out whether the press on "Scroll to latest" can leave the latest turn not counted as seen. It could be a product race in the seen/clear path, or the test pressing before the control is actionable or before the latest turn is in view.
  • Fix the real cause.

Out of scope

Acceptance criteria

  • The cause is shown with evidence: a trace, or a failing-first reproduction under load or with an injected delay at the press or the seen-recording step.
  • The fix keeps every assertion and deadline in the case. The case fails with the fix reverted under the same injected condition, and passes with the fix in place.
  • 30 sequential passes of the 390-phone case under load, recorded in the PR.

Verification

bun run test packages/ui-react/tests/parallel-sessions-runtime.test.ts, under the CPU load used for #2820, plus the hosted unit shard that carries the file.

Contract impact

None.

Readiness review: cause (2026-11-03)

This is a test race. The product's seen and clear path is correct. scrollUp (packages/ui-react/tests/parallel-sessions-runtime.test.ts:532-556) scrolls the phone transcript with three fast Input.dispatchTouchEvent swipes. Each swipe lifts its finger mid-motion, so Chromium follows each one with a fling, and that fling is still moving the transcript after scrollUp returns. If the press on "Scroll to latest" lands while the fling is running, the tap only stops the fling, and Chromium suppresses that tap, as a phone does. scrollToBottom never runs, the disc stays drawn, and C stays done, settled and cleared: false for the full 15 s. That is the recorded failure exactly.

Evidence: a trace of transcript scroll events shows the swipe's deltas still landing after scrollUp resolves and while C finishes. Lengthening C's log from 40 to 400 days means the fling cannot stop at the top before the press. With that change, the unmodified case fails 3/3 at line 721 with the hosted probe state.

Approach: each swipe carries its own event timestamps and holds the finger still before it lifts, so no fling starts, whatever the dispatch speed. Every assertion and deadline stays as it is.

2026-11-03: added this readiness section with the cause and evidence; scope and acceptance criteria are unchanged.

Status (2026-11-03)

#3409 fixes the race named above, and acceptance criteria 1 and 2 are met there: failing-first under the injected condition, then fixed, with a mutation receipt. Criterion 3, 30 sequential passes of the whole case under load, is blocked by #3406. That is a separate, earlier race at "selecting A cleared nothing" (line 678), and it caused all five failures across two loaded 30-run batches. The "Scroll to latest" step passed in all 55 loaded runs that reached it. Once #3406 lands, run the 30 passes under load on main and close this issue.

2026-11-03: added the Blocked by #3406 line and this status section.

Blocked by #3414

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.
    on Nov 2, 2026
  2. self-assigned this
    on Nov 2, 2026
  3. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Claim bk045-3377-20261102-scroll on branch fix/3377-parallel-sessions-scroll-clear. Readiness review first: tracing whether "Scroll to latest" can leave C uncounted as seen, keeping every assertion and deadline.

  4. added
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    on Nov 3, 2026
  5. added this to the 0.45.0 milestone on Nov 3, 2026
  6. added
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    on Nov 3, 2026
  7. schlessera commented on Nov 3, 2026

    @schlessera
    OwnerAuthor

    Handoff (2026-11-03): #3409 is a draft that is ready to confirm, head 6f99fd3493ca9643fb3079ab2033eeb5dd562389, milestone 0.45.0. Main was green at the handoff, but another PR held the integration lease, so confirmation has not been requested yet. To resume once the lease is free:

    bun scripts/integrate.ts confirm 3409 --issues schlessera/brain-kit#3377

    The PR uses Refs #3377: criterion 3 (30 loaded passes of the whole case) waits on #3406. Releasing this claim.

  8. removed their assignment
    on Nov 3, 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.blockedWaiting on another issue or an upstream dependency. Say which in the body.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: testCoverage, harness or proof work with no behaviour change.

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions