Your app showed the same order twice. Nobody wrote a bug.
transcript
You're scrolling your grocery order history. Page 2 loads. Its first order? The last one from page 1. Nobody wrote a bug.
Page 1 is offset 0, limit 20. It ends with order 20. Page 2 is offset 20. It starts with order 20. Again.
But here's the twist. While you read page 1, a new order arrived. It lands on top. Every row below it slides down one position. Position 21 is now order 20. The offset can't tell. It just counts.
A new order above you? One order shows twice. A delete above you? One order is never shown at all. Same bug, mirrored.
An offset counts positions. And positions move under your feet. A cursor remembers the last row you saw. New orders land above it, out of the way.
So the next page starts exactly where you stopped. No repeats. No gaps. Don't count rows. Remember the last one.
Full breakdown in the lecture.