diff --git a/web/src/screens/SchedulesScreen.test.tsx b/web/src/screens/SchedulesScreen.test.tsx index f9f945dc6..db1a56101 100644 --- a/web/src/screens/SchedulesScreen.test.tsx +++ b/web/src/screens/SchedulesScreen.test.tsx @@ -180,10 +180,13 @@ describe('SchedulesScreen — load', () => { // clamped to 100 server-side that skipped the first 100 rows — so the picker showed nothing at // all for the ordinary case of <=100 rerun collections. Assert the offset, not just the URL // shape: `pageNum=1` here is a silent empty picker, never an error. - for (const request of rerunRequests) { - const pageNum = new URL(request.url, 'http://localhost').searchParams.get('pageNum'); - expect(pageNum).toBe('0'); - } + // + // Assert only the FIRST request. Since #634 the loader legitimately walks pageNum 1, 2, … to + // page to completeness, so "every request is page 0" is an invariant the CORRECT code violates. + // It holds today only because this fixture's totalCount fits in one page — raising that default + // would fail this test with a misleading "requested page 1" signal for what is proper paging. + const firstPageNum = new URL(rerunRequests[0].url, 'http://localhost').searchParams.get('pageNum'); + expect(firstPageNum).toBe('0'); }); it('pages the rerun-collection picker to completeness when totalCount exceeds one page (#634)', async () => { diff --git a/web/src/screens/SchedulesScreen.tsx b/web/src/screens/SchedulesScreen.tsx index b350b82e6..ab30f1bb8 100644 --- a/web/src/screens/SchedulesScreen.tsx +++ b/web/src/screens/SchedulesScreen.tsx @@ -48,9 +48,9 @@ const DIRTY_PROMPT = 'You have unsaved schedule changes. Discard them?'; // precedent — the client pages, the server stays bounded). Mirrors CollectionsScreen.enterReorder. // // `pageNum` is 0-BASED here and everywhere on /api/v1 (api.paging-zero-based): the first page is 0, -// so the loop below starts its follow-up requests at 1. This call previously passed `pageNum: 1`, -// which skipped the first page entirely and showed nothing at all for the normal case of <=100 -// rerun collections (ersatztv#616) — the same call site, one defect earlier. +// so the loop below starts its follow-up requests at 1. Before ersatztv#616 this call site passed +// `pageNum: 1`, which skipped the first page entirely and showed nothing at all for the ordinary +// case of <=100 rerun collections — the same call site, one defect earlier. const RERUN_PAGE_SIZE = 100; async function loadAllRerunCollections(): Promise {