mediumBROKEN

Broken Pagination in Vibecoded Apps

Broken pagination in vibecoded apps shows duplicate items across pages, skips records, displays wrong total counts, or loads the same page regardless of which page number you click. AI-generated pagination logic is often off-by-one or ignores concurrent data changes entirely.

Last updated: 2026-03-14

Identifying Broken Pagination

Navigate through all pages of a paginated list and check for duplicate items appearing on multiple pages. Count the total items across all pages and compare with the displayed total count. If the numbers do not match, pagination logic is miscalculating offsets.

Test with different page sizes if the app allows it. Switch between 10, 25, and 50 items per page and verify the same records appear regardless of page size, just distributed across fewer or more pages. Also check if the URL updates when changing pages — if not, bookmarking or sharing a specific page is impossible.

Reproducing Pagination Bugs

Add or delete items while browsing paginated results. Create a new item on page one, then navigate to the last page and back. Items often shift between pages as the total count changes, causing duplicates or missing items. This is especially common in vibecoded apps using offset-based pagination.

Rapidly click between pages and watch for loading glitches. Click page 3, then immediately click page 5 before page 3 finishes loading. If page 3's data ends up displaying on the page 5 view, the app has a race condition in its pagination handler.

Fixing Pagination in Vibecoded Apps

Use cursor-based pagination instead of offset-based pagination for datasets that change frequently. Cursor-based pagination uses a stable reference point (like an ID or timestamp) and does not produce duplicates or gaps when items are added or removed during browsing.

Sync the current page with the URL using query parameters so pages are bookmarkable and shareable. Cache previously loaded pages to avoid redundant API calls, but invalidate the cache when the underlying data changes. Always handle the edge case where the user requests a page beyond the last page — redirect to the last valid page instead of showing an empty result.

Frequently Asked Questions

Why does pagination break so often in AI-generated apps?

AI tools typically implement naive offset-based pagination without handling edge cases like concurrent data changes, off-by-one errors in page calculations, or the relationship between page size, total items, and total pages.

What is cursor-based pagination and why is it better?

Cursor-based pagination uses a unique identifier from the last item on the current page to fetch the next batch. Unlike offset-based pagination, it does not skip or duplicate items when data changes between page loads.

How should I test infinite scroll?

Scroll to the bottom repeatedly until all items are loaded. Check for duplicate items, missing items, and whether the loading indicator stops when there is no more data. Also test scrolling back to the top — all previously loaded items should still be visible.

Ready to test your app?

Submit your vibecoded app and get real bug reports from paid human testers. Starting at just €15.

Related articles