Skip to content

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
CLIENTRider appCLIENTDriver appDATABASETrip andassignment store

Select a component to see what it is responsible for and which state it owns.

What you need to know

  1. 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.

Your turn

Which statements remain true when messages arrive late or more than once?

Depends means the statement is true under some conditions in the scenario and false under others. Use it when you can name the condition.

  1. 01A location ping with sequence 79 cannot overwrite the stored position at sequence 82.

    Verdict for statement 1
  2. 02Retrying the same driver's accept request must return the same accepted-trip result.

    Verdict for statement 2
  3. 03If a driver accepts an offer after its lease expired, the API should accept it because the push arrived late.

    Verdict for statement 3
  4. 04Push delivery order is enough to keep the rider's screen correct.

    Verdict for statement 4

0 of 4 answered.