You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
renderer: the older-page cursor is unguarded — dropping beforeIndex leaves the suite green #1493
The older-page cursor is unguarded: dropping it leaves the renderer suite green
Filed by cycle cyc20260921-051840 while reviewing #1489 (the GUI half of rant 2026-09-20T18:58:44). Not a defect in that PR — its code passes the cursor correctly, and the
library-level cursor semantics are well pinned. This is the missing guard between the library
and the component, measured with a mutation arm.
Measured
On #1489's head ba14a18f (renderer suite at the head: 46 files, 537 passed):
Nothing goes red. The older-page request therefore has no test asserting it carries the cursor.
Why it matters
Shell.test.tsx:181 is the file's only history case and it exercises the first page only
(includeRecords: true, no beforeIndex). history.test.ts covers the pure logic
(oldestIndex advances, overlap dropped by loaded, an empty page forces has_more=false).
Between them sits the wiring, and that wiring is the whole of the rant's defect 3 — paging
repeated, skipped and stranded records.
If a later edit drops beforeIndex, the behaviour that returns is exactly the reported symptom,
quietly: scrolling to the top re-fetches the newest window, unloadedRecords filters all of it out
because those records are already in loaded, and applyHistoryPage resets oldestIndex to the
same value it already had — so "load more" never advances and earlier content stays unreachable,
with a green suite and green CI.
What would close it
One case in Shell.test.tsx, in the shape of the existing one: load the first page, scroll the
transcript to the top (onLoadOlder / a scrollTop = 0 dispatch, as TranscriptView.test.tsx:291
already does), and assert the secondlistHistory call is expect.objectContaining({ includeRecords: true, beforeIndex: <the oldest record_index of page 1> }).
That case must go red under the mutation above.
A second, smaller case would pin the other half of the same wiring: that page 2's records are prepended as one block (replayHistoryRecordsPrepend) and page 1's are not re-appended — the prependEntries / shiftIndexes path added by the same PR, which today is exercised only through
the scratch-store unit and not through Shell.
Taken this cycle: #1495 (test/older-page-cursor-guard) adds both cases this issue asks for — the older-page request's beforeIndex, asserted through the component's own scroll listener, and the block-prepend order. Mutation arm on the PR head: deleting beforeIndex: st.oldestIndex now gives 2 failed | 32 passed, where before the change the same deletion left all 537 green. — cycle cyc20260921-051840
#1493's complaint was that the older-page cursor was unguarded — dropping beforeIndex: st.oldestIndex from the loader left the suite green, so the guard could be deleted without a single test noticing. #1495 adds the two renderer tests that pin it (the cursor the request carries, and the prepended page's order).
Re-measured on the merged tree, not taken from the PR text. In a checkout of master 2a2f3d20's tree, deleting beforeIndex: st.oldestIndex now fails exactly the two added tests — 2 failed | 32 passed (34) in Shell.test.tsx — where the same deletion previously left the file green. The reverse arm (reversing the prepended block) fails only the ordering test, so the two assertions carry separate weight.
The landing tree measured before the merge (78982d0b25e1, suite 4601 passed / 22 skipped) is byte-identical to the tree the merge produced.
Activity
argszero commentedon Sep 20, 2026
Taken this cycle: #1495 (
test/older-page-cursor-guard) adds both cases this issue asks for — the older-page request'sbeforeIndex, asserted through the component's own scroll listener, and the block-prepend order. Mutation arm on the PR head: deletingbeforeIndex: st.oldestIndexnow gives2 failed | 32 passed, where before the change the same deletion left all 537 green. — cyclecyc20260921-051840argszero commentedon Sep 21, 2026
Closed by #1495, merged as master
2a2f3d20.#1493's complaint was that the older-page cursor was unguarded — droppingbeforeIndex: st.oldestIndexfrom the loader left the suite green, so the guard could be deleted without a single test noticing.#1495adds the two renderer tests that pin it (the cursor the request carries, and the prepended page's order).Re-measured on the merged tree, not taken from the PR text. In a checkout of master
2a2f3d20's tree, deletingbeforeIndex: st.oldestIndexnow fails exactly the two added tests —2 failed | 32 passed (34)inShell.test.tsx— where the same deletion previously left the file green. The reverse arm (reversing the prepended block) fails only the ordering test, so the two assertions carry separate weight.The landing tree measured before the merge (
78982d0b25e1, suite 4601 passed / 22 skipped) is byte-identical to the tree the merge produced.