She typed kale j. The box said kalonji seeds.
transcript
Ananya types kale j. She wants black shoes. The box suggests kalonji seeds. Nothing crashed. The answers just arrived out of order.
She types kal. Request 1 leaves. She keeps typing. Request 2 leaves, for kale j. On 4G, answer 2 comes back first. The right list, for a second. Then answer 1 lands. Late. And it replaces everything.
The app shows whatever arrived last. So the oldest question gets the final word.
Abort the old request? It saves the client's work. But the request already left. The server got it. The real fix: a counter that moves on every keystroke. An answer renders only if its number is still the latest.
Send only after a short pause. Fewer requests in flight. Cache every prefix in the tab. Backspace is free. And answer 1? It fails the check. Dropped.
Networks reorder. Your app shouldn't. An old answer must never beat a new one.
Full breakdown in the lecture.