Skip to content

A till that refuses says so, mid-service - #137

Merged
sridharkalaibala merged 1 commit into
mainfrom
fix/a-till-that-refuses-says-so
Sep 18, 2026
Merged

sridharkalaibala merged 1 commit into
mainfrom
fix/a-till-that-refuses-says-so

Conversation

@sridharkalaibala

Copy link
Copy Markdown
Contributor

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:

The till is turning this phone away
The till is on and answering, so the Wi-Fi is fine. The shop has probably run out of handset slots. Free one on the till, or add a slot, then press Try now.

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.js gains two, both driving a request from a screen that is already working, which is the case the search path never sees:

  • a till that refuses says so, mid-service
  • and it does not throw the waiter back to a sign-in screen

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.

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.
@sridharkalaibala
sridharkalaibala merged commit 710926d into main Sep 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant