Skip to content

Hardware Manager stops saying three things that are not true - #650

Merged
sridharkalaibala merged 1 commit into
developfrom
fix/hardware-manager-tells-the-truth
Sep 13, 2026
Merged

sridharkalaibala merged 1 commit into
developfrom
fix/hardware-manager-tells-the-truth

Conversation

@sridharkalaibala

Copy link
Copy Markdown
Contributor

Owner, after setting up two printers and sending a test receipt: "i gave sample print i seed this."

The screen whose whole job is to prove the hardware works said three things, and none of them were true.

1. "Sent undefined bytes."

The test print reads result.bytes. The handler stopped answering it when it learned to drive several printers: the old single-printer version returned { success, bytes }, the rewrite returned a summary that forgot to carry it.

It now adds up what each successful copy actually sent. A refused copy contributes nothing, so a failed print cannot claim bytes it never wrote.

2. "No printer selected." under a list with a printer ticked

The summary was written once when the list was drawn and once more after a save. Nothing listened in between, so ticking a printer changed nothing on screen until Save was pressed.

It now follows the ticks, and the copies and paper size too. The listener is delegated from the container, because the rows are redrawn on every reload and anything bound to them would be thrown away with them. The kitchen list has always had a listener; the receipt list never did.

3. "KOT polling started! Listening for new orders every 5 seconds."

Two errors in one sentence. A sale announces itself the moment it is saved, so tickets do not wait for a timer at all. And the poll underneath, which is the net that catches what an event missed, has been thirty seconds since that event bus went in, not five.

Now: "Kitchen printing is on. Tickets print as orders arrive."

Why this matters more than it looks

A diagnostic screen that lies is worse than no diagnostic screen. It sends somebody looking at their printer, their cable and their driver when the fault is on this page.

Tests

tests/hardware-manager-tells-the-truth.test.js pins all three, plus that only successful copies are counted toward the total. Desktop suite 1,949 passing.

The owner set up two printers and sent a test receipt. The screen whose
whole job is to prove the hardware works told him, in this order:

  "Sent undefined bytes. Check that every amount ends flush right."
  "No printer selected."  - under a list with a printer visibly ticked
  "KOT polling started! Listening for new orders every 5 seconds."

None of them were true.

The byte count went missing when the print handler learned to drive several
printers: the single-printer version answered { success, bytes } and the
rewrite answered a summary that forgot to carry it. It now adds up what each
successful copy actually sent, so a refused print cannot claim bytes it
never wrote.

The summary was written when the list was drawn and again after a save, and
nothing listened in between, so ticking a printer changed nothing on screen
until Save was pressed. It now follows the ticks. The listener is delegated
from the container because the rows are redrawn on every reload and anything
bound to them would be thrown away with them.

And a sale has announced itself the moment it is saved since the event bus
went in, so tickets do not wait for a timer at all; the poll underneath is
the net that catches what an event missed, and it has been thirty seconds,
not five. The line now says what actually happens.

A diagnostic screen that lies is worse than no diagnostic screen: it sends
somebody looking at their printer when the fault is here.

tests/hardware-manager-tells-the-truth.test.js pins all three, and pins that
only successful copies are counted.
@sridharkalaibala
sridharkalaibala merged commit eca6366 into develop Sep 13, 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 13, 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