fix(desktop): retry a transient update-check failure once before surfacing it - #4811
Open
Adarsh-Me wants to merge 1 commit into
Open
fix(desktop): retry a transient update-check failure once before surfacing it#4811Adarsh-Me wants to merge 1 commit into
Adarsh-Me wants to merge 1 commit into
Conversation
…acing it The packaged update check intermittently fails with "Cannot parse releases feed": electron-updater resolves "latest" through GitHub's releases Atom feed, and GitHub intermittently answers that request with HTTP 406 and an empty body — the identical request succeeds seconds later (apache#4790). The app surfaced that first failure as an error toast even though the check was never going to stay broken. A check now retries once after a two-second backoff, on the injected clock. While the retry is pending, the 'error' listener holds a check failure back instead of publishing it, so a transient refusal never reaches the renderer as an error state or toast; a retry that also fails publishes exactly as before. Download and install errors are unchanged — they surface immediately. dispose() clears the retry timer alongside the schedule timer. Closes apache#4790
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.
Summary
Fixes #4790's user-visible failure mode: the startup update check intermittently surfaces "检查更新失败 / Cannot parse releases feed" when GitHub transiently answers electron-updater's releases-feed request with HTTP 406 and an empty body — the identical request succeeds seconds later, so the first failure is noise, not an outage.
AppUpdateService.checkForUpdatesnow retries once after a two-second backoff (on the injected clock). While the retry is pending, theerrorlistener holds a check failure back instead of publishing it, so a transient refusal never reaches the renderer as an error state or toast; a retry that also fails publishes exactly as before. Download and install errors are unchanged — they surface immediately.dispose()clears the retry timer alongside the schedule timer.Two scope notes from #4790:
Maka-Agent/maka-agentpublish config is already fixed onmain(electron-builder.config.mjspublishes toowner: apache, repo: maka); the staleapp-update.ymlonly exists inside installed v0.1.11 packages and is replaced by the next install. This PR therefore changes only the failure handling.allowPrereleasechannel gating, unchanged here.Verification
biome checkon both changed files: clean.tsc --strictpass overapp-update-service.ts: no errors beyond missing-node_modules artifacts (NodeJSnamespace,setImmediate), which the workspace toolchain supplies.app-update-service.test.tscover both paths: a first-attempt 406-style failure (error emitted and thrown, as electron-updater does) that recovers on retry with noerrorstatus ever published, and a persistent failure that surfaces exactly oneerrorstatus after twocheckForUpdatescalls. Full file: 17/17 pass. Run standalone withtsx --testagainst realelectron-updater@6; the workspacetestpipeline will re-run it under CI.AI use
Select exactly one:
Tool(s) and scope:
Checklist
errorstatus and a singlecheckForUpdatescall; the second fails with zeroerrorstatuses published.Does this PR entail a change in behavior?