Skip to content

Fix: retry button on update failures, and stop the dialog redrawing per chunk - #89

Merged
broisnischal merged 1 commit into
masterfrom
fix/updater-retry-and-speed
Sep 25, 2026
Merged

broisnischal merged 1 commit into
masterfrom
fix/updater-retry-and-speed

Conversation

@broisnischal

@broisnischal broisnischal commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Reported from the update dialog: no way to retry after a failed check, and both checking and updating feel slow.

Retry

A failed check printed the raw transport error and stopped there. The only recourse was to dismiss the dialog and find the command palette entry again. There is now a Retry button next to Not now, and it re-runs whatever actually failed: the download when an update is already in hand, otherwise a fresh check.

Header said the wrong thing

The screenshot shows Checking for updates… above an error body. The header tested checking before status, and checking is still true while the failed check unwinds, so the spinner text outranked the result. A settled outcome now wins, and starting a new check clears the previous one so the header is not stale in the other direction either.

The endpoint URL is a single unbreakable token and ran past the dialog edge; it wraps now.

Speed

before after
check() timeout none (HTTP stack default) 15s
dialog redraws while downloading one per HTTP chunk, thousands for a 100MB build one per frame

downloadAndInstall reports a Progress event per chunk and every one of them wrote $state, re-rendering the dialog at that rate. The running total is now accumulated outside reactivity and published on a requestAnimationFrame.

The download is deliberately left unbounded. A timeout there would break exactly the slow connections that need it most; only the small latest.json check is bounded.

Verification

Forced the reported failure and rendered the dev build headlessly:

Couldn't check for updates
Stroke could not reach the update server.
error sending request for url (https://github.com/stroke-app/stroke/releases/latest/downl…
[ Not now ]  [ ⟳ Retry ]

Header, wrapped error text and both buttons confirmed in the DOM.

The update dialog had no way out of a failure. A check that could not reach
GitHub printed the raw transport error and stopped there, so the only recourse
was to close the dialog and find the command palette entry again.

Retry re-runs whatever actually failed: the download when an update is already
in hand, otherwise a fresh check.

Three things around it were wrong in the same dialog:

- The header read "Checking for updates…" over an error body, because it tested
  `checking` before `status`, and `checking` is still true while the failed
  check unwinds. A settled outcome now outranks the spinner, and starting a new
  check clears the previous one so the header is never stale in either
  direction.
- The endpoint URL is a single unbreakable token and ran past the dialog edge.
- `check()` had no timeout, so an unreachable host held the dialog on
  "Checking for updates…" for whatever the HTTP stack's default is. Bounded to
  15s. The download is deliberately left unbounded: a timeout there would break
  exactly the slow connections that need it most.

Downloading was also redrawing far more than it painted. downloadAndInstall
reports one Progress event per HTTP chunk, thousands of them for a build this
size, and every one wrote $state. The running total is now kept out of
reactivity and published once a frame.
@broisnischal broisnischal added the release:patch Bump patch version (0.0.x) label Sep 25, 2026
@broisnischal
broisnischal merged commit 03bdece into master Sep 25, 2026
1 check passed
@broisnischal
broisnischal deleted the fix/updater-retry-and-speed branch September 25, 2026 05:30
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release:patch Bump patch version (0.0.x)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant