fix: validate update manifests before selecting a source [skip release]#27

merged1
stack/ci-github-hosted
stack/update-fallback
opened7d agobySScreen
View on GitHubTwo-way sync enabledPR last imported 7d ago

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.ts fail (manifest read failure, malformed manifest, version/source/size/SHA512 rejection, both sources failing).
  • After: desktop/updates.test.ts 56/56 pass; npm test passes; npm run build and check: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