fix(smartupdate): improve update check caching, validation, and error handling

This commit is contained in:
2026-05-10 15:05:00 +00:00
parent d049d1a1e9
commit 3d1a73cf9e
12 changed files with 376 additions and 114 deletions
+22
View File
@@ -0,0 +1,22 @@
# smartupdate improvement plan
Status: implemented.
## Goal
Make update checks predictable, cache-safe, and testable without changing the core public API shape.
## Implementation
- Fix CLI cache behavior so cached update information still reports an available update and time-based cache entries expire.
- Cache both `update-available` and `up-to-date` results so normal repeated CLI runs do not keep hitting the registry.
- Store cache context with each entry and only reuse cache entries for the same package, current version, and registry.
- Preserve more useful error types for invalid package names, invalid versions, package lookup failures, and registry failures.
- Await and catch changelog opening so browser failures do not become unhandled promise rejections.
- Replace live npm tests with deterministic registry stubs and ephemeral cache storage.
- Remove unused dependency surface.
## Verification
- Run `pnpm test`.
- Run `pnpm run build`.