Skip to content

fix(desktop): gate the sidebar-snapshot loading tests on the boot read - #140

Merged
QuicksilverSlick merged 1 commit into
mainfrom
fix/sidebar-snapshot-read-gate
Nov 3, 2026
Merged

QuicksilverSlick merged 1 commit into
mainfrom
fix/sidebar-snapshot-read-gate

Conversation

@QuicksilverSlick

Copy link
Copy Markdown
Owner

Three tests in sidebar-snapshot.spec.ts waited 500 ms after goto for the loading skeleton while the mock channels read resolved at 600 ms. If the app rendered later than about 350 ms after load, the window was missed. They failed 3/3, retries included, on #75 and #76.

Fix

This follows the pattern from #68, a test-controlled gate instead of a timer:

  • Bridge: new deferFirstChannelsRead config option. It arms the bridge's existing one-shot channels-read hold at install, because the boot read fires before a spec can call the runtime seam.
  • Helpers: pendingChannelsRead(page) and releaseChannelsRead(page).
  • Tests: "first-ever boot", "a different identity's snapshot" and "partial hash/list write" now hold the read, assert the loading state with the normal timeout, check the same payload and diagnostic as before, release the read, then assert the end state.

Each test keeps its original assertions and also checks that the skeleton is gone after release. The "matching not-modified" test now uses the new helpers in place of its inline evaluate calls, with no behaviour change. No timeouts were raised and no product code changed: only the spec, its helper and the E2E mock bridge.

Verification

Whole spec, one worker, private port, system Chrome:

Run Result
New spec, --repeat-each=10 100/100 passed
New spec, --repeat-each=10, 2x CPU (CDP) 100/100 passed
Old spec from origin/main, the three tests, --repeat-each=3, 2x CPU 9/9 failed on the 500 ms window

pnpm typecheck and pnpm check pass in desktop/. pnpm check still prints 3 warnings in files this PR doesn't touch.

Not fixed here

Two other timed windows in this spec remain. Both passed 10/10 at 2x CPU and both failed at least once in 3 repeats at 4x:

  • "community switch" asserts the switched rows within 500 ms against a 600 ms read. It's the same kind of race, but on a click rather than a boot.
  • "cold boot" has a 2 s paint deadline. The slowest paint at 2x was 1547 ms. The deadline looks deliberate, since other tests in the spec rely on it.

At 4x, plain boot can also exceed the default 5 s expect timeout: one of the gated tests failed that way, as did tests with no timing window. So 4x isn't a useful bar for this spec.

Factory-Task: desktop-e2e/sidebar-snapshot-read-gate
Built-by: claude-code/claude-opus-5-5
Undo: revert; only the spec, its helper and the E2E mock bridge change, and the tests go back to the 500 ms window.

🤖 Generated with Claude Code

Three tests waited 500 ms after goto for the loading skeleton while the
mock channels read resolved at 600 ms, so a render later than about
350 ms missed the window. They failed 3/3 on fork #75 and #76 and fail
every time at 2x CPU.

Arm the bridge's existing one-shot channels-read hold from config, so
it covers the boot read, and hold that read until the test releases it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@QuicksilverSlick QuicksilverSlick added the lane:ready Builder is done: green, agent-reviewed, exercised. The steward puts it in the next train. label Nov 3, 2026
@QuicksilverSlick
QuicksilverSlick merged commit 133fb3f into main Nov 3, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:ready Builder is done: green, agent-reviewed, exercised. The steward puts it in the next train.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant