mirror of
https://github.com/block/buzz.git
synced 2026-10-27 20:41:57 +00:00
## Summary
This fixes the Desktop Smoke E2E failure that turned `main` red at
af7979e ([run](https://github.com/block/buzz/actions/runs/39295686771)).
The failing test was `video-attachment.spec.ts` "playback speed persists
across videos and reloads". The cause is a real timeline bug, not a
problem in the test.
When the reader leaves the bottom, `MessageTimeline` freezes the live
tail and sets a one-shot flag. The flag tells it to ignore the next "at
bottom" report, because freezing the tail can shorten Virtua's model and
produce a false one. If nothing is buffered, the freeze doesn't change
the model, so that false report never arrives. The flag then stays set
and swallows the reader's real return to the bottom. If the reader gets
back to the bottom in one scroll event, the tail stays frozen and new
messages wait behind a "1 new message" pill even though the reader is
already at the bottom. A scrollbar jump, the End key, or Playwright's
scroll-into-view retry all return in one event.
In CI, the Play click was intercepted, so Playwright retried it with
different scroll alignments. That moved the timeline away from the
bottom (scrollTop 430 → 289 → 430, seen in the run's trace), and the
second video message was buffered and never rendered.
Fix: once the freeze commits with nothing buffered, clear the flag. If
the reader is already back at the bottom, release the tail.
### Related issue
None found. No open PR touches this.
### Testing
- New smoke test `virtualization.spec.ts` "a single scroll back to the
bottom releases the live tail": failed 10/10 before the fix, passed
10/10 after (`--repeat-each=10`).
- `video-attachment.spec.ts` "playback speed persists…": 20/20 passed
with `--repeat-each=20`.
- Smoke runs of `virtualization`, `scroll-history`, `video-attachment`,
`messaging`, `smoke`, `file-attachment` and `thread-follow`: 188 passed.
3 failed with a blank page before the first click, and all 3 passed on
re-run. Unmodified `main` shows the same failure locally, so it's a
local preview-server flake and unrelated to this change.
- `pnpm typecheck`, `pnpm check`, and `pnpm test` (6829 + 160 tests) all
pass.
Signed-off-by: Fizz <6be7be23ec5bba868f3e1db5ec86013d76bd1a293dce5b435a192158fec13641@buzz.block.builderlab.xyz>
Co-authored-by: Fizz <6be7be23ec5bba868f3e1db5ec86013d76bd1a293dce5b435a192158fec13641@buzz.block.builderlab.xyz>