The Actual Root Cause of the Missing-Rows Bug
After the timezone hypothesis is ruled out in the case study, what turns out to actually be causing rows to go missing from the CSV export?
The correct answer is "A single-column cursor with no tiebreaker skips same-timestamp rows."
The export's keyset pagination cursor advances on created_at alone
with a strict > comparison. If a row is inserted with the exact
same timestamp as the last-read cursor value, after the page
containing that cursor value has already been read but before the
next page is fetched, the strict > comparison skips it — the
cursor has already advanced past that instant. It's a missing
tiebreaker column on the pagination cursor, not a filtering bug.
The distractors describe things ruled out or never true in the case study: the timezone-boundary filter was the earlier, discarded hypothesis; nothing in the narrative involves the generated Prisma client caching stale results; and no rate limit is ever implicated in the missing rows.
Share this question