fix: validate update manifests before selecting a source [skip release]#27
Summary
Closes #2. The updater now selects a source only after its release metadata and manifest both validate, so a bad manifest in the preferred repository falls back to the original one.
diff
| 1 | for source in [preferred, original] |
| 2 | try |
| 3 | release = releaseAssets(read(source.latest)) |
| 4 | - if release: break |
| 5 | -candidate = validateCandidate(release, read(manifest)) # throws, no fallback |
| 6 | + if release: candidate = validateCandidate(release, read(manifest)) |
| 7 | + if candidate: break |
Version, architecture, size and SHA512 checks, source isolation, drain and guarded quit are unchanged.
Evidence
- Before: 9 new regressions in
desktop/updates.test.tsfail (manifest read failure, malformed manifest, version/source/size/SHA512 rejection, both sources failing). - After:
desktop/updates.test.ts56/56 pass;npm testpasses;npm run buildandcheck:desktop(Windows) pass.
Not verified: installed or live-provider updates.
Merge Danger
Door: two-way
Blast Radius: updater
View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.
Added 1 commit
- fix: validate update manifests before selecting a source42544b2