A till that refuses says so, mid-service - #137
Merged
Merged
Conversation
Owner listed it as its own cause: "server not allowing (403)". I said I would not guess at it. This is what it turned out to be. Nothing in the app did anything with a 403. The SEARCH path knew about refusals and named which till refused, but that screen is only reached while somebody is looking for a server. A phone already signed in and working never goes there - so mid-service a refusal arrived as whatever generic error the calling screen happened to show, usually "could not do that", which sends a waiter to find the manager, who restarts a till that is working perfectly. A dead address gives a connection error. Only a server sends back a status. So a 403 means the till is ON, on this Wi-Fi, and turning this phone away - almost always because the shop has run out of handset slots, which is a licence screen rather than a power button. Named at the request layer, where every screen sees it, and shown on the outage screen so it is visible rather than buried in a toast. A refusal outranks every other cause there, because it is the only one the till has confirmed; everything else on that screen is inference from silence. NOT session.end(). A 401 means this credential is no good and signing in again is the answer. A 403 means the credential is fine and the shop has no room, and throwing the waiter back to a sign-in screen makes them type a password in order to be refused a second time. There is a test for that, because it is the tempting wrong fix.
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.
You asked why this was not done. I said I would not guess at it. Here is what it turned out to be.
Nothing in the app did anything with a 403. Grepping for it found three comments and no handling.
The search path knew about refusals and named which till refused. But that screen is only reached while somebody is looking for a server. A phone already signed in and working never goes there, so mid-service a refusal arrived as whatever generic error the calling screen happened to show, usually "could not do that", which sends a waiter to find the manager, who restarts a till that is working perfectly.
What a 403 actually means
A dead address gives a connection error. Only a server sends back a status. So a 403 means the till is on, on this Wi-Fi, and turning this phone away, almost always because the shop has run out of handset slots. That is a licence screen, not a power button.
The change
Named at the request layer, where every screen sees it, and shown on the outage screen so it is visible rather than buried in a toast:
A refusal outranks every other cause on that screen, because it is the only one the till has confirmed. Everything else there is inference from silence.
The tempting wrong fix, and a test against it
Not
session.end(). A 401 means this credential is no good and signing in again is the answer. A 403 means the credential is fine and the shop has no room, so clearing the session makes a waiter type a password in order to be refused a second time.There is a test asserting the token survives a 403.
Tests
tests/server-resolution.spec.jsgains two, both driving a request from a screen that is already working, which is the case the search path never sees:477 unit tests and 330 browser tests pass. Tamil added.
That closes the last of the four causes you listed: Wi-Fi changed, no network at all, till not running, and now refusing.