Skip to content

A table call that arrived by sync makes a sound - #859

Merged
sridharkalaibala merged 3 commits into
developfrom
fix/a-synced-call-makes-a-sound
Sep 17, 2026
Merged

sridharkalaibala merged 3 commits into
developfrom
fix/a-synced-call-makes-a-sound

Conversation

@sridharkalaibala

Copy link
Copy Markdown
Contributor

What

The last gap in tonight's waiter-call lane. A call from the ordering page now reaches a till (Gateway #14, POS #853), but it landed in the request dock silently: the dock polls, so the call appeared within seconds, while the sound a counter-made call raises comes from the API's insert path, which a synced row never takes.

A pulled waitercalls row now rings the arrival bell once, exactly what a synced-in order gets from the same place (_announcePulled), tagged state: 'waiter', and sends nothing to the kitchen printer; nobody cooks a call.

What it deliberately does not do

It does not ring until answered. A counter-made call does, because the API knows the call's id and the dock's "seen" resolves that id. The agent's pull line carries a count, not ids, and the queue endpoint the dock reads sits behind router.use(protect), so the repeating alarm for a synced call is a further step: a kiosk-keyed read of the open calls registered before the session guard, then waiting per call_id and posnic:order-resolved when a call leaves the list. Written beside the code so the bell is not mistaken for the alarm.

Tests

tests/a-cloud-order-reaches-the-kitchen-at-once.test.js 10/10: a pulled call makes exactly one received sound with state: 'waiter' and raises no kitchen-ticket event; "pulling anything else stays quiet" still holds. Desktop suite 2,895/2,896; the one failure (executable-scripts: scripts/check-installed-app.js committed non-executable) is already on develop and is fixed in its own PR.

"Call waiter" on the ordering page writes into the cloud database. The
lane that brings it down was built tonight (Gateway "A call reaches the
till", #853), and what arrived landed in the request dock silently: the
dock polls, so the call showed within seconds, but the sound a
counter-made call raises comes from the API's insert path, which a synced
row never takes.

A pulled call now rings the arrival bell once, the same treatment a
synced-in order gets, and sends nothing to the kitchen printer. It does
not ring until answered: that alarm needs the call's id so that "seen"
can stop it, and the agent's line carries a count. What that next step
needs is written beside the code.
scripts/check-installed-app.js declares a shebang and was committed
100644. cron or a deploy that calls it by path gets 'permission denied'.
tests/executable-scripts.test.js has refused the suite over it since it
landed; this is the mode bit, nothing else.
@sridharkalaibala
sridharkalaibala merged commit 92b51b7 into develop Sep 17, 2026
9 checks passed
@github-actions github-actions Bot added the ready for QA Merged to develop and live on develop.posnic.io - anyone can test it label Sep 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Merged to develop. Anyone can test this - you do not need write access.

Try it at https://develop.posnic.io, or run it yourself:

git fetch origin develop && git checkout develop
npm install && npm --prefix api install
npm run dev   # then http://localhost:3000

When you have tested it, say what you did and what happened, and set
QA passed or QA failed. If you cannot set labels, just comment -
a maintainer will.

Reporting that something is broken is as useful as fixing it. It is
better found here than by a shopkeeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for QA Merged to develop and live on develop.posnic.io - anyone can test it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant