Repository navigation
fix(desktop): answer the setup page's probes off the event loop - #860
Open
dustywusty wants to merge 1 commit into
Open
dustywusty wants to merge 1 commit into
dustywusty wants to merge 1 commit into
Conversation
already_running and last_failure were synchronous Tauri commands, so they ran on the event-loop thread and waited there on the startup lock, which installation holds for the whole image download. A setup page that loaded mid-install froze the window until the download finished. Both are now async commands that do their work in spawn_blocking, as the other startup-lock commands (show_openbot, sign-in) already do. Follow-up to #822.
dustywusty
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso,
mxmzb and
tylerslaton
as code owners
October 27, 2026 22:31
7 tasks done
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch has not been deployed
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.
What this changes
Follow-up to #822, as asked in review there.
already_runningandlast_failurewere synchronous Tauri commands. Tauri runs those on the event-loop (main) thread, where both waited onshell.startup, whichprepare_installationholds for the whole image download. If the setup page loaded again during an install, the window froze until the download finished.Both are now
asynccommands that do their work intauri::async_runtime::spawn_blocking, the same as the other commands that take the startup lock (show_openbot, the sign-in commands). They still wait for the lock, but on a blocking-pool thread, so the window keeps answering. What each returns is unchanged. The old bodies are kept asalready_running_nowandlast_failure_now, which the existing tests call.If the blocking task panics,
already_runninganswersfalseandlast_failurereturns aProbleminstead of failing silently.Root cause
shell.startup.lock()synchronously; it became a freeze when Fix fresh desktop setup and Mac sign-in #591 (2e43afd) hadprepare_installationhold that lock across the image download. fix(desktop): keep the window responsive while installation holds the startup lock #822 fixed the same freeze inrestore_window_onand noted these two as left over.#[tauri::command]runs insideWebview::on_message, on the event-loop thread, so a lock held for minutes blocked the UI thread.setup_page_probes_do_not_wait_on_the_event_loop_for_startup_held_by_installationholds the startup lock and sends both commands throughon_message, the window's real IPC entry point. It requireson_messageto return within 5 s, no answer before the lock is released, and the correct answers afterwards. With the commands synchronous again it fails (Timeout).Where it runs
Boundary and audit
Changelog
CHANGELOG.mdunderUnreleased("The desktop setup page does not freeze when it loads during an install").Proof
Timeout) and passes after.cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings,cargo test --locked --lib --bins(541 lib, 150 bin) pass on macOS arm64. Windows and Linux left to CI.