fix: prevent blank screen after desktop auth - #169
Merged
Conversation
Soulter
marked this pull request as ready for review
August 14, 2026 04:46
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new
sharedStateobject inrunBootstrapis growing multiple responsibilities (local/session storage, navigation, app mount state); consider encapsulating these into a small mock runtime/helper to keep the test harness easier to extend and reason about. - In
shouldReloadAfterDesktopAuthBootstrap, you unconditionally set the session storage flag when it doesn't exist yet; if a reload is blocked by the environment (e.g., in tests or non-WKWebView contexts), you might want to consider only flipping the flag afterreloadis actually invoked to avoid silently disabling future reload attempts.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new `sharedState` object in `runBootstrap` is growing multiple responsibilities (local/session storage, navigation, app mount state); consider encapsulating these into a small mock runtime/helper to keep the test harness easier to extend and reason about.
- In `shouldReloadAfterDesktopAuthBootstrap`, you unconditionally set the session storage flag when it doesn't exist yet; if a reload is blocked by the environment (e.g., in tests or non-WKWebView contexts), you might want to consider only flipping the flag after `reload` is actually invoked to avoid silently disabling future reload attempts.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Summary
Root cause
The desktop authentication bridge could finish while Vue Router was still resolving its initial navigation. Updating the auth hash during that window could leave the WKWebView dashboard with an empty
#appnode. A manual reload worked because the token had already been persisted by then.User impact
The dashboard should no longer remain on a white screen during the first launch after passwordless authentication. The bridge reloads at most once per WebView session and starts the dashboard with a stable token.
Validation
node --test scripts/prepare-resources/bridge-bootstrap-updater-contract.test.mjs— 7 passednode --check src-tauri/src/bridge_bootstrap.jscargo fmt --manifest-path src-tauri/Cargo.toml -- --checkcargo test --manifest-path src-tauri/Cargo.toml --quiet— 162 passedgit diff --checkSummary by Sourcery
Guard desktop passwordless authentication to avoid blank initial loads in the desktop dashboard while preserving automatic token refresh.
Bug Fixes:
Enhancements:
Tests: