Somebody else got there first, and the waiter is told so - #117
Merged
Merged
Conversation
A save sends the WHOLE order and the till keeps only what arrives, which is how a cancelled dish gets cancelled. On a floor with several handsets it is also how food goes missing: another waiter adds a biryani while this screen is open, this screen saves a list that never had it, and the till removes a dish the kitchen has already cooked. The bill goes out short and nobody is told. So both saves now say which version of the order they were looking at - the order's own timestamp, handed back exactly as it arrived, nothing guessed - and the till refuses one written against an older version. Posnic/POS#821 is that half. Being refused is not an error message. The waiter did nothing wrong and lost nothing, because what they typed was never sent. They are told that somebody else changed the order, the sheet closes rather than sitting there looking ready for a second tap at the same refusal, and the order is fetched again so the screen tells the truth. What happens next is theirs: only a person knows whether the dish somebody else added was meant to go. An order nobody has ever edited falls back to when it was opened, so a first edit is guarded too - which is the case a busy table hits most. An ordinary failure still reads as a failure. A server that is down is a different problem, and a waiter must not be told somebody edited the order when nobody did. The new sentence is not in the Tamil pack yet: that file is being rewritten in the coverage PR and adding a line here would collide with it. It follows once that lands.
The sentence shown when somebody else has changed the order was left in English because the pack was being rewritten in another branch at the time and a line here would have collided with it. That branch has landed, so the loose end closes rather than waiting to be noticed by a waiter who reads Tamil and meets one English sentence at the worst moment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The handset half of Posnic/POS#821.
A save sends the whole order and the till keeps only what arrives, which is how a cancelled dish gets cancelled. On a floor with several handsets it is also how food goes missing:
The bill goes out short and nobody is told.
What the phone now does
Both saves that rewrite the item list - the edit sheet and the move sheet - say which version of the order they were looking at. It is the order's own timestamp, handed back exactly as it arrived, nothing guessed. The till refuses a save written against an older one.
A full cancel is deliberately untouched. Cancelling the whole order is an intentional act on the order as a whole, and blocking it on a conflict would stop a legitimate cancel.
Being refused is not an error message
The waiter did nothing wrong, and lost nothing: what they typed was never sent.
What happens next is theirs. Only a person knows whether the dish somebody else added was meant to go.
An order nobody has ever edited falls back to when it was opened, so a first edit is guarded too - which is the case a busy table hits most.
An ordinary failure still reads as a failure. A server that is down is a different problem, and a waiter must not be told somebody edited the order when nobody did.
Tests
Full suite: 302 passed.
One loose end, now closed
The new sentence shipped untranslated in the first commit, because #116 was rewriting the Tamil pack at the time and a line here would have collided with it. That merged, so the second commit adds it - rather than leaving a waiter who reads Tamil to meet one English sentence at the worst possible moment.
Note on rollout
POS#821 is on
develop. Until it promotes tomain, the handset sendsseen_atand the live till ignores it. That is harmless by design - silence means yes - but two phones can still erase each other in production until that promotion happens.