--- id: "bug-1903" status: "open" status_updated: "2026-10-01" status_note: "newly logged" component: "apiserver" severity: "wrong-result" timestamp: "2026-10-01T12:21:25Z" last_seen: "2026-10-01T12:21:25Z" occurrences: 1 files: ["src/frontend/apiserver/controllers/jobs.go", "src/frontend/apiserver/store/query.go"] tags: ["apiserver", "query", "pagination", "code-review"] related: [] --- # bug-1903: apiserver GetJobsInfo page_token does not advance: the next page repeats the first ## Description **Observed:** found by the reviewer of task 7.3 (spec job-array-one-based-index) while comparing handler behaviour with HEAD in a unit-test harness: following the `page_token` returned by `GET /xce/v1/jobs` (`GetJobsInfo`) returns the same page again instead of the next one. Reproduced at HEAD (before task 7.3) with a plain filter `{submit_user:eq:all}` and a small `limit`, so it is not caused by the element-selection work. **Expected:** passing the returned `page_token` yields the next page of rows, and the last page returns no token. **Impact:** wrong result: clients that page through job listings (`xcecli jobs list` with paging, REST callers) see the first page repeatedly and never reach later jobs. **Found by:** review (task 7.3 of spec job-array-one-based-index, 2026-10-01) ## Environment - OS: no /etc/os-release; Docker container; NixOS kernel; kernel Linux 6.18.33 x86_64 - libc: n/a (pure-Go handler path); host glibc 2.40 - Toolchain: gcc (GCC) 15.2.0, meson 1.9.1, Go from the nix dev shell - Build: asan (build.jai); exercised through the non-cgo Go unit-test build of src/frontend/apiserver (the defect is in pure Go) - Code: scheduler-framework @ c30e5f1d (HEAD before task 7.3) and 3457d892 - Deployment: none (controllers handler test with an in-memory store); any apiserver with more jobs than the page limit ## Reproduction 1. In a controllers handler test (non-cgo, `jobs_handler_test.go` fixture), seed more jobs than the page limit. 2. `GET /xce/v1/jobs?filter={submit_user:eq:all}&limit=2`; read `page_token` from the response. 3. Repeat the request adding `&page_token=`: the rows are the same as the first page. - Frequency: deterministic (reviewer probe, 2026-10-01) - Evidence: not kept (reviewer's temporary probe test, deleted) ## Root cause TODO: required for fixed/partial ## Fix TODO: required for fixed/partial ## Verification - Test: TODO: name + file; RED before the fix, GREEN after - Suites: TODO: suite results and build profile - Live: TODO: soak/deploy run, or n/a and why ## References - Related: bug-1898 (found while fixing it)