Stage 4 of 5 · Break it
A delayed location or offer cannot undo newer state
Mobile networks reconnect and replay work. Arrival order is not event order, so both the live-location record and the trip state need a rule that makes stale messages harmless.
System so far· 3 parts
Select a component to see what it is responsible for and which state it owns.
What you need to know
Keep a monotonic sequence on driver pings and a version on each trip transition. A consumer applies an event only if it advances the stored value. This works only when the compare and update are atomic; checking the version in application code and writing later reopens the race.