Pagination shows current page, total pages, and prevents invalid page numbers
Why it matters
Pagination without visible progress context — no current page number, no total page count — leaves users navigating blind. Under ISO 25010:2011 reliability, an application that crashes or returns an unhandled error on an out-of-range page number has a reliability defect. The failure surface is trivially reachable: any user who manually edits ?page=999 in a URL, or who follows a stale link to a page that no longer exists, hits the boundary. A crash response (500, unhandled exception, blank page) signals to search engine crawlers and users alike that the application is fragile.
Severity rationale
High because missing page context disorients users and out-of-bounds page requests that crash the application create a reliability defect visible to both users and crawlers.
Remediation
Clamp the requested page to [1, maxPage] on the server before querying, and render page progress explicitly in components/Pagination.tsx.
// Server: clamp before querying
const maxPage = Math.ceil(totalCount / pageSize)
const safePage = Math.min(Math.max(1, requestedPage), maxPage)
// components/Pagination.tsx
<span>Page {currentPage} of {totalPages}</span>
<button disabled={currentPage === 1} onClick={() => onPageChange(currentPage - 1)}>
Previous
</button>
<button disabled={currentPage === totalPages} onClick={() => onPageChange(currentPage + 1)}>
Next
</button>
Never pass an unclamped page number to OFFSET — out-of-range offsets return empty results silently or, worse, trigger database errors if the offset exceeds integer bounds.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Search & Discovery UX Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · reliability — Fault Tolerance — graceful handling of out-of-range input
Taxons
History
- 2026-04-18·v1.0.0·Initial import from directory-search-discovery·automated