Review Pagination for Correctness
Added 2026-11-04
Unstable ordering makes pages duplicate or skip rows.
Here is a paginated query or endpoint. Check: 1) whether the sort key is unique and stable, since ties cause duplicates or skipped rows; 2) what happens when rows are inserted or deleted between pages; 3) whether offset pagination degrades on deep pages; 4) suggest a more robust scheme — cursor or keyset pagination; 5) point out edge cases: empty result, last page, concurrent writes.
Site original
Chinese original
How to use
分页 bug 的典型症状:同一行出现两次,或某行永远看不到。
Try tweaking it
- Have it restate requirements and constraints before writing code.
- Ask for the smallest change plus a rollback path, not a full-file rewrite.
What you should get
- A minimal, runnable change with copy-ready code
- Impact list: which files and call sites must follow
Common mistakes
- Asking it to touch ten files at once, then losing track of what broke what.
- Pasting only the error, with no code or version, and getting an unfixable answer.
How to check the output
- The change runs, can be rolled back, and touches nothing unrelated.
- Edge cases (empty, oversized, concurrent) are covered or explained.
Where it works
- Good for: having it restate requirements and constraints, then propose the smallest runnable change.
- Watch out: include versions and a minimal reproduction with the error, or the fix may look plausible but not fit.