Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3594.
Calling the asynchronous
saveWindowStatecommand while resize/move events are processed can deadlock: the worker holdsWindowStateCachewhile waiting for a native getter, and the event loop waits for that cache lock.Dispatch the command's existing save operation to the main thread and await its result. Validate flags before dispatch and propagate scheduling, save and dropped-task errors. This avoids replacing the cache from a stale snapshot. Add a running MockRuntime regression for the execution thread, serialized state, filesystem failures and invalid flags, plus paired Rust/JS patch changesets.
Verified locally on macOS 27.0.1 arm64 with Rust 1.97.1, Tauri 2.12.0, Wry 0.57.0 and Tao 0.37.1, based on
df594206ce03f67e25da04283dea023815a45058:is_minimizedto return through the event loop.cargo test --locked --offline -p tauri-plugin-window-state --all-targets --all-features: 1 regression passed.cargo clippy --locked --offline -p tauri-plugin-window-state --all-targets --all-features -- -D warnings: passed.cargo +1.90.0 check --locked --offline -p tauri-plugin-window-state: passed.cargo test --locked --offline -p tauri-plugin-window-state --doc: command passed, 0 doc tests.The synchronous Rust API and exit-time save behavior stay as before. Direct worker calls through that API remain outside this fix. The save still performs synchronous filesystem I/O on the main thread; there is no new guarantee about latency or draining queued saves at shutdown. Windows/Linux/mobile, manual move/title-bar zoom and the official WebDriver suite were not run.
AI assistance: Codex helped with implementation, test design and internal code review. The results above were executed locally; they are not upstream CI results.