Skip to content

Promote develop to main: the announcement reaches a window that can play it - #864

Merged
sridharkalaibala merged 2 commits into
mainfrom
develop
Sep 17, 2026
Merged

sridharkalaibala merged 2 commits into
mainfrom
develop

Conversation

@sridharkalaibala

Copy link
Copy Markdown
Contributor

One fix, and it is the one most likely to bite the kitchen machine specifically, so it should reach main before the exe is re-staged.

What main currently does

() => BrowserWindow.getAllWindows().find((w) => w && !w.isDestroyed()) || null

The 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.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.

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.js hands OrderAlert () => mainWindow). Both roads are changed, the real ticket through kot-manager.js and the Test button through main.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 build or npm 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.

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
@sridharkalaibala
sridharkalaibala merged commit cec4992 into main Sep 17, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant