Why does order 1008 show up on two pages?
transcript
You scroll your order history. Page 1 ends with order 1008. Then page 2 starts with order 1008 again. Nothing crashed. So why is it repeated?
Page 2 starts at position 4. That was fine a moment ago. But a new order, 1012, arrived at the front. Everything shifted down one place. Position 4 is now order 1008.
The fix is to remember a place, not a number. Remember the last id you showed. Ask for the four orders older than 1008. A new order at the front can't change that. No repeat, and no gap. The id stays where it was, even as the table grows.
There is a price. You can't jump straight to page 7. A place is reached by walking, not by counting. People scroll, they don't jump. Most feeds and APIs accept that.
Page numbers shift. The last id seen doesn't.
Full breakdown in the lecture.