fix(desktop): prevent blank screen during session restore - #134
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughDesktop session restoration now uses synchronous history replacement and router flushing. Startup catches restoration errors, logs them, and continues mounting. Tests cover route restoration, embedded-runtime no-ops, pending restoration, and thrown errors. ChangesDesktop session restoration
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant main.tsx
participant redirectToLastPage
participant RouterHistory
participant QueryBridge
main.tsx->>redirectToLastPage: invoke synchronously
redirectToLastPage->>RouterHistory: replace startup location
redirectToLastPage->>RouterHistory: flush router
main.tsx->>QueryBridge: initialize query bridge
main.tsx-->>main.tsx: log restoration error if thrown
Merge Risk: ⚪ Minimal · up to No concrete outstanding risk remains from the session-restoration changes; the test mocks are reset between cases as configured. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit hops through startup light Comment |
Deploying gitru with
|
| Latest commit: |
1fafdd2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://feae391d.gitru.pages.dev |
| Branch Preview URL: | https://ruru-fix-blank-startup.gitru.pages.dev |
What
Why
A production cold start with last-page set to /app awaited router.navigate before RouterProvider mounted. The URL changed, but the navigation promise could not settle, so createRoot was never reached and the window stayed blank.
The tauri_runtime_wry web content process terminated debug line was a misleading signal; WebContent remained alive and bundled assets loaded normally.
How
Startup restoration now replaces and flushes TanStack history synchronously. RouterProvider then owns the initial route load, while the bootstrap boundary catches malformed persisted state so first paint still proceeds.
Validation
Compatibility note
Draft PR #133 also edits apps/desktop/src/main.tsx in the startup block and may need a small rebase depending on merge order.
Summary by CodeRabbit
Bug Fixes
Tests