Menu

Offset pagination silently skipped 0.4% of our transactions
📰

Offset pagination silently skipped 0.4% of our transactions

DEV Community: backend·Payneteasy·10 days ago
#mws4Jq7M
#devtobackend#devto#dev#rows#list
Reading 0:00
15s threshold

Reconciliation job pulled the daily transaction list from a gateway API with page=1..N, 100 rows per page, sorted by created_at descending. It ran at 02:00 while the batch of late-arriving settlements was still being written. Totals were off by a few dozen transactions on most days, and never the same ones.

Mechanics: between fetching page 3 and page 4, 40 new rows landed at the top of the sorted list. Everything shifted down by 40. Page 4 started with 40 rows we had already seen on page 3, so those got duplicated, and the 40 rows that slid past the page boundary on the other side were never fetched. Our dedup by transaction ID hid the duplicates, so the only visible symptom was a missing amount.

On a 12,000-row day we lost about 0.4%, roughly 50 rows.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.