Skip to content

Opening a starting app shows "is still starting (0s)" at once, and the 10-second toast is irregular #142

Closed

Description

@nixfred

What happens

openApp() in web/src/openApp.ts calls onWaiting(waited) on every probe, with waited = Math.round((Date.now() - started) / 1000). The Store's Open button (web/src/screens/Store.tsx, around line 670) uses it to toast every 10 seconds:

openApp(live, liveUrl, {onWaiting: (sec) => sec % 10 === 0 && toast(`${live.name ?? app.name} is still starting (${sec}s)…`)})
  1. The first probe happens immediately, so sec is 0 and 0 % 10 === 0 is true. The "Opening X…" toast that was shown a moment earlier is replaced at once by "X is still starting (0s)…".
  2. The loop sleeps 2000 ms plus the time the probe takes, so sec drifts and only lands on a multiple of 10 by chance. Simulating the loop with a probe that takes 100 ms gives these values for sec: 0, 2, 4, 6, 8, 11, 13, 15, ... 29, 32, ... 38, 40, 42, ... 50, 53 ... so the toast shows at 0, 40, 50, 80, 90, 120, 130 and so on, with gaps of 30 seconds and runs of consecutive ones. With a 50 ms probe it shows at 0 and 10, then not again until 70.

So the user sees a wrong "0s" message and then an erratic number of reminders.

How to reproduce

Start an app so its web page is still "starting" (for example restart Home Assistant), open the Store page for it and press Open. The toast "…is still starting (0s)…" appears immediately.

For the drift, I ran this in node:

let t = 0; const seen = []
while (true) { const w = Math.round(t / 1000); if (w > 180) break; seen.push(w); t += 100 + 2000 }
seen.filter((x) => x % 10 === 0)   // [0, 40, 50, 80, 90, 120, 130, 160, 170]

Expected: no toast at 0 s, and one about every 10 seconds.

Suggested fix

In the caller, skip sec === 0 and track the time of the last toast (for example toast when sec - lastShown >= 10) instead of testing sec % 10.

Environment

Omarchy Server main (0786ba9, 0.9.50), Node 26.

Activity

  1. calledtoconstruct commented on Nov 22, 2026

    @calledtoconstruct
    Collaborator

    Working to resolve this.

    No open pull request references this issue, and no one has commented that they are working on it.

    #526, #342, #525, #524, #527, #133, #102, #777, #129, #239, #243, #236, #233, #232, #242, and #443 share the app store with this and will land in one pull request.

    🤖 Generated with Grok 4.7

  2. calledtoconstruct commented on Nov 22, 2026

    @calledtoconstruct
    Collaborator

    Thanks @nixfred. A starting app waits before the first toast, then shows one about every 10 seconds. This ships in #876.

    🤖 Generated with Grok 4.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions