Skip to content

A call carries its date - #853

Merged
sridharkalaibala merged 3 commits into
developfrom
fix/a-call-carries-its-date
Sep 17, 2026
Merged

sridharkalaibala merged 3 commits into
developfrom
fix/a-call-carries-its-date

Conversation

@sridharkalaibala

Copy link
Copy Markdown
Contributor

What

The other half of Gateway #14 ("A call reaches the till").

The waiter-call row was a native insert with no updated_date. The sync agent finds its work with { updated_date: { $exists: true } } and the gateway sends a till only rows whose updated_date moved, so even with the lane built the call would have stayed in the cloud for ever. Same trap as the settings save (#838).

change why
callWaiter stamps created_date and updated_date the row can leave the cloud
seeWaiterCall moves updated_date in its $set the cloud learns the call was answered; the ordering page stops saying "already calling"
collections.json: waitercalls back to synced: branch the promise is true again; the packaging guard keeps checking it against the agent actually bundled

Tests

tests/a-call-carries-its-date.test.js pins both writes by method (the "seen" one is the one that gets lost) and the decision. sync-classification.test.js 5/5; node scripts/prepare-sync-agent.js passes against a Gateway checkout on the #14 branch (23 promised, 23 bundled).

Merge order

Stacked on #851. Merge Gateway #14 first (that merge deploys the gateway), then #851, then this. The cloud tenants need this API deployed before a call written by the ordering page carries its date; tills need the next installer for the "seen" stamp.

Not in this PR

A chime at the till when a pulled call arrives. The request dock shows it on its poll; the sound that a counter-made call raises needs the call id at the till, which the pull line does not carry. Follow-up.

The waiter-call feature marked its collection synced the day it shipped.
Nothing built the lane: the sync agent has none, the sync-gateway allows
none, and no build since has carried one. A call from a table on the
ordering page lands in the cloud and a till with its own database never
sees it.

The packaging guard compared the promise with the bundle and refused the
build, which is what it is for. This records the truth: waitercalls is
undecided, with what it will take to sync it written next to it. The
classification test now names it among the undecided instead of the
promised.
The waiter-call row was a native insert with no updated_date. The sync
agent finds its work with { updated_date: { $exists: true } } and the
gateway sends a till only rows whose updated_date moved, so even with the
lane built (Gateway "A call reaches the till") the row would have stayed in
the cloud for ever. Same trap as the settings save (#838).

The row is stamped on the way in, and again when the till marks it seen,
so the cloud learns the call was answered and the ordering page stops
telling the customer "already calling".

waitercalls goes back to synced, per branch. It was moved to undecided
when the packaging guard found the promise had no lane behind it; the
guard keeps checking, against the agent actually bundled.
@sridharkalaibala
sridharkalaibala merged commit d5e8acd 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