Skip to content

fix(desktop): keep stream timeline pinned through settle#1320

Open
wesbillman wants to merge 1 commit into
mainfrom
pinky/e2e-stream-stability
Open

fix(desktop): keep stream timeline pinned through settle#1320
wesbillman wants to merge 1 commit into
mainfrom
pinky/e2e-stream-stability

Conversation

@wesbillman

Copy link
Copy Markdown
Collaborator

Summary

  • keep the stream timeline's at-bottom anchor through synthetic/programmatic scroll events unless recent real user scroll input occurred
  • tighten the stream E2E scrollability helper so it waits for real seeded receiver rows and a bounded pinned postcondition instead of treating the empty intro height as ready
  • dedupe the stream specs through the pinned helper so failures report the same postcondition

Why this matters

Recent main/release failures showed stream.spec.ts intermittently stuck with distanceFromBottom around 205 while the receiver timeline still had the empty/intro content in the scroll container. A sidebar-only PR (#1319) reproduced the same deterministic 205, which points at shared timeline infrastructure rather than the app code under test in those PRs.

The root cause is the timeline latching an away-from-bottom message anchor from synthetic scroll events emitted during virtualizer settle or burst appends. The user never scrolled, but the app could still show the unread pill and stop chasing the true bottom.

Verification

  • pnpm --dir desktop check
  • pnpm --dir desktop build
  • ./scripts/start-relay-for-tests.sh --profile ci && ./scripts/setup-desktop-test-data.sh && pnpm --dir desktop exec playwright test --project=integration tests/e2e/stream.spec.ts --repeat-each=3 → 30/30 passed
  • Re-ran pnpm --dir desktop check after final cleanup

Masking check:

  • both fixes together → 30/30 green
  • app fix removed while keeping the helper tightening → red (REVERT_PROOF_TEST_STATUS=1, 2/30 failures)

The revert-one failures tripped during seed propagation/visibility rather than the original 205 assertion. That is still the same no-user-scroll anchor-latch race surfacing at a different point in the seed burst; the important result is that the helper-only change does not carry the shard green.

Programmatic virtualizer scroll events can briefly report an off-bottom gap while rows finish measuring, causing anchored scroll state to latch a message anchor before the bottom pin settles. Track recent real scroll input and ignore synthetic off-bottom events while the explicit bottom-settle guard is active so resize re-pins can chase the true floor without swallowing legitimate history-prepend restores.

Also tighten the stream E2E helpers so they wait for real seeded messages, joined receiver participation, and a pinned timeline instead of treating the tall empty-state intro as proof that the receiver is ready.

Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
@wesbillman wesbillman force-pushed the pinky/e2e-stream-stability branch from 863cc02 to 787f5f2 Compare June 27, 2026 01:07
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.

1 participant