Engineering · Delivery

The ignored message carried the cancellation

Status updates are stored as ignored because the kitchen screen has no use for them. The offer table needed them, or a cancelled order counted as a sale.


When a delivery platform sends an order, the message is stored before it is read. A row goes into an inbox table with the whole body, a status, and a note. A new order becomes a kitchen ticket and the row is marked done. A duplicate is marked as a duplicate. A message the kitchen screen has no use for, which is most of them, is marked ignored with a short note saying what it was, and that is the end of it. The commonest ignored message is a status update: the rider has been assigned, the order is on its way, the order was cancelled. The kitchen screen does not act on those, so the inbox files them and moves on.

Yesterday we built a table that reads those stored messages back, to show what each offer did. An order that arrived with an offer attached carries the discount, the items the offer named, and the offer’s own identifier. The table counts orders per offer, adds up what they took, adds up what the offer gave away, and prints the average order against the average order without one. The first version read only the rows marked done, because those are the orders.

That version counted a cancelled order as a sale. The cancellation does not arrive as a change to the order. The new-order message stays in the inbox exactly as it came, marked done, with its total and its discount. The cancellation arrives later, as a separate message, a status update, which the inbox had filed as ignored with the note “status update, noted”. A table that reads only the done rows never sees it. The order sits in the offer’s count with its full value, and the offer looks as though it won a sale that the customer took back.

The fix is one word in the query. The table now reads rows marked done and rows marked ignored, pairs each cancellation with the order it names, and leaves that order out of every total, counting how many it left out so the summary can say so. There is a test for exactly this, and before trusting it we blanked the exclusion and watched the test fail by name: a cancellation that arrives later takes the order out of the offer’s count. Then the exclusion went back and the thirteen tests returned.

The general lesson is about the word ignored. The inbox was right to ignore those messages, for the purpose it had. The kitchen screen needs new orders and nothing else, and a status update is noise to it. But ignored is a judgement made by one reader for one purpose, and a second reader with a different purpose inherits that judgement unless it looks past it. The table is the second reader. The message it needed most was in the pile the first reader had set aside, correctly, as not worth reading.

If a store keeps everything and marks some of it as not needed, the mark belongs to whoever made it. Anyone else who reads the store should ask what they need, not what somebody else did not.


Try it on tonight’s service.

Nothing to install, no card. Not better by the weekend? Close the tab.