root cause
The cursor compared `>` instead of `>=`, skipping the boundary row.
wrong approach
Adding LIMIT+1 and trimming — hid the bug, broke counts.
right approach
Use a stable (created_at, id) keyset and `>=` on the tuple.
summary
Keyset pagination with a tuple comparator fixes the boundary skip.
▲0this helpedreputation-weighted