Skip to content

fix(catalog): reject empty refresh response in native shell (parity with #101) - #108

Merged
msitarzewski merged 1 commit into
mainfrom
fix/native-catalog-empty-response-guard
Jun 22, 2026
Merged

msitarzewski merged 1 commit into
mainfrom
fix/native-catalog-empty-response-guard

Conversation

@msitarzewski

Copy link
Copy Markdown
Owner

Native-shell parity for @Arvuno's Tauri fix (#101).

When a catalog refresh parses to a valid but empty JSON array, the native CatalogService.refresh() now throws CatalogRefreshError.emptyResponse before gzip/persist/in-memory-swap — so a hostile mirror, a partial body, or a CDN error page that happens to be an empty JSON array can't silently zero out the user's catalog. A rejected refresh keeps the previous good catalog, mirroring the Tauri refresh_catalog_inner guard exactly.

Safe on every OS: cask.json comes from the formulae.brew.sh API, not the OS-gated local brew layer, so it's non-empty regardless of platform.

Build: green.

🤖 Generated with Claude Code

…rity with #101)

Native parity follow-up to Arvuno's Tauri fix (#101): when a catalog refresh
parses to a valid-but-empty JSON array, throw `CatalogRefreshError.emptyResponse`
BEFORE persisting or swapping the in-memory catalog, so a hostile mirror /
partial body / CDN error page can't silently zero out the user's catalog. The
guard sits before gzip/write, so a rejected refresh keeps the previous good
catalog — mirroring the Tauri `refresh_catalog_inner` guard exactly. Safe on
every OS: cask.json comes from the formulae.brew.sh API, not the OS-gated local
brew layer, so it's non-empty regardless of platform.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@msitarzewski
msitarzewski merged commit 07dfd41 into main Jun 22, 2026
@msitarzewski
msitarzewski deleted the fix/native-catalog-empty-response-guard branch June 22, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant