Repository navigation
fix: room Load more paginates the oldest timeline - #54
Merged
Merged
Conversation
After a gappy sync the live timeline is the far side of a hole; joining it to an older timeline nulls its backward token, so hasMore went false while older history remained. Paginate the oldest timeline in the unfiltered set (same first-event ordering as gapStartTimelines) and read hasMore from its token. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
zooidbot
commented
Oct 6, 2026
zooidbot
left a comment
Collaborator
Author
There was a problem hiding this comment.
Lead review: no blocking findings. The fix applies ZNC103 D5 on the room side. oldestTimeline shares its ordering with gapStartTimelines, so "Load more" and the gap marker can't disagree about which timeline is the oldest. Two of the three new tests are a direct regression assertion for the join. Falling back to the live timeline for an empty room keeps the brand-new-room behaviour. Not verified (a live gappy sync) is acceptable for an S bug whose mechanism is unit-tested. Merging.
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.
Closes #51
Repro: after a gappy (
limited: true) sync the live timeline is the later side of a hole.useLoadMoreHistorypaginatedroom.getLiveTimeline()and readhasMorefrom its backward token; once pagination joined it to the older timeline, the SDK'ssetNeighbouringTimelinenulled that token and the button hid while the older timeline still had its own token. Reproduced in vitest (makeRoom(..., { timelineSupport: true })+room.resetLiveTimeline(...)): two of the three new tests fail onmain's hook and pass with the fix.Fix:
useLoadMoreHistorynow paginates the oldest timeline in the room's unfiltered set and readshasMorefrom its backward token (ZNC103 D5, room side). The ordering is shared withgapStartTimelinesvia a newoldestTimeline(room)inuse-timeline.ts, which falls back to the live timeline while the room has no events. No chain walk (D4): the room anchor is always a chain head.useLoadMoreThreadis untouched.Tests:
pnpm -C packages/web typecheckclean;pnpm -C packages/web test152 files / 965 tests pass.Not verified: manual run against a real gappy sync (no Matrix stack in the sandbox); no lint script exists in this repo.
Knowledge impact: ZNC103 D5 (draft, zooid-ai/product#46) names this as its room-side twin; no shipped spec went stale. ZNC024 only records the pagination fixes as a prerequisite.
Plan feedback: the issue's build notes were accurate. The one gap: it says to join the timelines in the test but not how.
setNeighbouringTimelineon both sides plus aRoomEvent.TimelineResetemit is enough, andgapStartTimelinesdrops empty timelines, so the helper needed a live-timeline fallback.🤖 Generated with Claude Code