Offline basket
What to do when the connection of a lane is lost in the middle of a basket.
Your lane software keeps the basket in its own memory while it cannot reach the API, and sends what it has not sent in the order it happened. Two rules of the API make that safe: a request with an operationId is applied once, and a request with an expectedRevision is applied only to the revision you read.
Keep every request
Store the request body, with its
operationId, before the first attempt to send it.Send again with the same
operationIdA request that reached the system is not applied twice. The answer is the same operation result.
Read the basket when the connection returns
If a request was lost, the basket is behind. Read it and send the requests it does not have, with the revision you read.
Stop on a conflict
A
409withrevision_conflictmeans an attendant or a device changed the basket. Read the lane and the interventions before you send anything more.
The weight of the bagging scale is a reading, not an event: after a lost connection, report the weight the scale carries now. See Weights and produce codes.