Repository navigation
Fix: retry button on update failures, and stop the dialog redrawing per chunk - #89
Merged
Merged
Conversation
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.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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 testedcheckingbeforestatus, andcheckingis 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
check()timeoutdownloadAndInstallreports 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 arequestAnimationFrame.The download is deliberately left unbounded. A timeout there would break exactly the slow connections that need it most; only the small
latest.jsoncheck is bounded.Verification
Forced the reported failure and rendered the dev build headlessly:
Header, wrapped error text and both buttons confirmed in the DOM.