Promote develop to main: the announcement reaches a window that can play it - #864
Merged
Merged
Conversation
The kitchen ticket was announced to getAllWindows().find(w => !w.isDestroyed()) - the FIRST window, whatever it happened to be. That is a gamble everywhere and a bad one here, because of where this feature runs. A kitchen machine is exactly the machine likely to have the kitchen display open, and a support, log or hardware window can be in front of the dashboard at any moment. Only the dashboard carries the player. src/kitchen-screen.html has one inline script and no kitchenCall in it at all, so a ticket announced into that window is announced into nothing - silently, with no error, which is the same failure this feature has already had twice: once from a stale bundle and once from a CSP. The window is now chosen by what it is showing rather than by where it sits in a list. The alarm beside it always had this right: main.js hands OrderAlert () => mainWindow. The announcement did not. Both roads are changed, the real ticket through kot-manager and the Test button through main.js, because a Test button that takes a different road from a real ticket is the thing that passes while the kitchen stays silent. It falls back to any open window rather than to none. Before anybody signs in the only window is the sign-in screen, which has no player either, but a shop with nobody signed in has nobody in the kitchen, and silence then is correct rather than a fault.
…noise The announcement reaches a window that can play it
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.
One fix, and it is the one most likely to bite the kitchen machine specifically, so it should reach
mainbefore the exe is re-staged.What
maincurrently doesThe kitchen ticket is announced to the first window, whatever it happens to be.
That is a bad gamble precisely here. A kitchen machine is exactly the machine likely to have the kitchen display open, and a support, log or hardware window can sit in front of the dashboard at any moment.
Only the dashboard carries the player.
src/kitchen-screen.htmlhas one inline script and nokitchenCallin it at all, so a ticket announced into that window is announced into nothing, silently, with no error.This is the third distinct cause of the same symptom found today, after a shipped bundle that predated the player and a CSP that refused the sound. None of the three logged anything.
The fix
The window is chosen by what it is showing, the way the order alarm always did (
main.jshandsOrderAlert() => mainWindow). Both roads are changed, the real ticket throughkot-manager.jsand the Test button throughmain.js, because a Test button taking a different road from a real ticket is the thing that passes while the kitchen stays silent.Eight tests, including one asserting that nothing in either file still picks a window by position, and one asserting the kitchen display really has no player, so that if somebody gives it one later the failing test says to widen the choice rather than delete the check.
After this
Re-stage with
npm run buildornpm run publish. Then on the kitchen machine:npm run check:installed, Core Settings, both switches on, press Test the sound.Do not squash. A squashed release PR conflicts with the next one.