Fix the timeline loading a room's entire history on open - #1373
Merged
Conversation
eleboucher
marked this pull request as ready for review
July 26, 2026 12:15
eleboucher
marked this pull request as draft
July 26, 2026 14:14
eleboucher
force-pushed
the
fix/timeline-runaway-pagination
branch
from
July 26, 2026 14:47
b9f33db to
72b0580
Compare
eleboucher
marked this pull request as ready for review
July 26, 2026 15:42
Member
Author
|
play wright is flaky because of c10y |
eleboucher
force-pushed
the
fix/timeline-runaway-pagination
branch
from
July 26, 2026 15:55
72b0580 to
33c3095
Compare
Contributor
Deploying with
|
| Status | Preview URL | Commit | Alias | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! | https://pr-1373-sable.raspy-dream-bb1d.workers.dev | 33c3095 | pr-1373 |
Sun, 26 Jul 2026 15:56:58 GMT |
11 tasks
7w1
approved these changes
Jul 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Opening a room paginated until it ran out of history, scrolling the view up as it went. Worst rooms burned 8-10s of CPU per open on a Pixel 3a.
The viewport-fill effect compared
processedEvents.lengthagainst a value captured in the same render, so the guard was always true and the condition reduced to!hasRealScrollRoom || atTop. It re-runs on every length change, so staying near the top kept it firing. Pre-existing since March, triggered by #1363 leaving fewer rendered events per page.Also in here:
setAtBottomwas only called from the scroll handler, so a resize (composer, keyboard) left it stale and killed auto-follow. Now recomputed from the ResizeObserver.onFocusChanged, sincefocusin/focusoutmiss app switches. Mobile and web unchanged.Pixel 3a, release builds, CPU per room open:
Fixes #1371
Type of change
Checklist:
AI disclosure: