Skip to content

fix(desktop): return store errors for stale resource IDs - #2768

Closed
richiemcilroy wants to merge 1 commit into
mainfrom
fix/tauri-store-invalid-resource
Closed

richiemcilroy wants to merge 1 commit into
mainfrom
fix/tauri-store-invalid-resource

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Loading a Tauri settings store after its resource has been removed panics in the plugin's cached-ID lookup. Return BadResourceId through the existing Result instead, so the caller can handle the failure and subsequent lookups do not encounter a poisoned store registry.

Backports tauri-apps/plugins-workspace#3157 onto the vendored 2.4.0 plugin. The first fixed release, 2.4.2, requires Tauri 2.9.3; this keeps Cap's locked Tauri 2.8.5 and all existing runtime dependency versions. The copied upstream runtime sources differ only at that lookup. Generated upstream JavaScript and schema files stay byte-for-byte unchanged and are excluded from Biome.

The regression uses the real plugin with Tauri's mock runtime: load and save a store, clear resources with cleanup_before_exit, then perform repeated lookups and verify the saved bytes are unchanged. A separate test covers normal close/reopen behavior. Both tests now run in the existing Windows and macOS CI jobs.

Validation:

  • Original 2.4.0 reproduced the exact invalid-resource panic; patched regressions pass (2 tests) against Cap's lockfile.
  • Plugin cargo check and Clippy with all targets and warnings denied passed.
  • Workspace Rust formatting, repository Biome formatting, scoped Biome check, plugin-version consistency, and its 8 tooling tests passed.
  • Repository lint fails with the same 208 errors and 91 warnings as unchanged main; every diagnostic matches.
  • Full desktop cargo check and workspace Clippy were attempted but blocked by missing FFmpeg development files (libavutil.pc) in the Linux environment.
  • Full TypeScript checking was attempted but blocked by missing web dependencies (next).
  • Native Windows/macOS app execution remains untested locally.
  • At head eaa5bcbb5e30ea247d7ca9ba61149a1803f1efdf, CI passed, including Windows/macOS store lifecycle regressions and Clippy, Typecheck, and all GPUI desktop jobs. Real-capture verification, Windows Target Discovery, and Perf budget also passed.
  • Engine verify failed on two independent macOS static-screen fragment-span cases. The engine/muxer dependency and feature graphs match base and do not include Tauri/store; the same cases failed in an earlier run before this patch. Its automatic retry reproduced both failures. No recording tests or bounds were changed.

This hardens the retained Tauri app used by 0.6.0. Current GPUI release code does not use this store plugin. Resource cleanup is a reproduced cause of this panic; the production event's precise lifecycle trigger remains unconfirmed.

@blacksmith-sh

blacksmith-sh Bot commented Oct 20, 2026

Copy link
Copy Markdown

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
cap-verify::crash/crash_safety View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@richiemcilroy

Copy link
Copy Markdown
Member Author

Closing as part of the post-0.6.1 PR cleanup: Tauri: vendors tauri-plugin-store 2.4.0 with a stale-resource-ID backport; only the Tauri app uses tauri-plugin-store, GPUI does not depend on it

This branch was successfully deployed

2 active deployments
Preview – cap-web — eaa5bcbb Deployed Oct 20, 2026 by vercel[bot]
Preview – cap-status — eaa5bcbb Deployed Oct 20, 2026 by vercel[bot]
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