Skip to content

Fix rooms staying unread in the new timeline(labs) - #35997

Draft
langleyd wants to merge 4 commits into
developfrom
fix/new-timeline-rooms-stay-unread
Draft

langleyd wants to merge 4 commits into
developfrom
fix/new-timeline-rooms-stay-unread

Conversation

@langleyd

Copy link
Copy Markdown
Member

Fixes the "rooms stay unread" reports on #35124

This PR fixes 3 cases where the new timeline didn't send a read receipt, so the room stayed unread:

  • Opening a room that fits on screen. We only told the view model what was on screen after a scroll, so if nothing scrolled no receipt was sent. It now also reports once the first messages are shown.
  • Leaving a room quickly. A receipt waits 500ms before it's sent(so we don't fire it for all messages displayed) and leaving the room within that time meant it never got sent. It's now sent when you leave.
  • Messages with an earlier timestamp than the last one read (e.g. from a server with a slow clock) never got a receipt, as we compared timestamps. It now compares positions in the timeline instead.

While fixing the first one I found that during a jump (permalink, jump to unread) TanStack's onChange can still report the position from before the jump, which would send a receipt for the wrong message. Commit 1 adds isScrollPending() to our TanStack patch so the view can skip those updates, plus two small TanStack fixes where it got stuck waiting for a scroll that could never happen. I've opened this upstream as TanStack/virtual#1388.

AI assistance

  • I used AI tools to help create this PR.

The timeline only updated the view model with what was on screen after a scroll, so in a room that fits on screen it never did, and no read receipt was sent. It is now also updated once placement finishes.

An update that arrives while TanStack is still waiting for a scroll it wrote to be read back still describes where a jump started, so it is skipped; the read-back brings another.
A receipt waits half a second before it is sent, and leaving the room within that time dropped it, so the room stayed unread.
The new timeline only sent a receipt for a message with a later timestamp than the last one, so a message from a server with a slower clock was never marked as read. Compare positions in the timeline instead.

This branch was successfully deployed

3 active deployments
EndToEndTests — 6b6e2e36 Deployed Nov 20, 2026 by github-actions[bot]
Netlify — 6b6e2e36 Deployed Nov 20, 2026 by github-actions[bot]
SharedComponentStorybook — 6b6e2e36 Deployed Nov 20, 2026 by github-actions[bot]
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