Repository navigation
Hardware Manager stops saying three things that are not true - #650
Merged
Merged
Conversation
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.
Contributor
|
Merged to 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:3000When you have tested it, say what you did and what happened, and set Reporting that something is broken is as useful as fixing it. It is |
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.
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.jspins all three, plus that only successful copies are counted toward the total. Desktop suite 1,949 passing.