fix(desktop): render the offline page and server picker in packaged builds - #7464
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThe PR replaces packaged desktop recovery-page
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains. The previously reported retry issue is fixed: once the bundled page fails, later timer cycles continue loading the configured origin without navigating to the broken offline page again.
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/local-pages.ts | Introduces the privileged, session-scoped sim-shell: handler with exact host and filename allowlists and ordered asset roots. |
| apps/desktop/src/main/load-health.ts | Prevents repeat navigation to a bundled offline page after that page fails while retaining the origin recovery timer. |
| apps/desktop/src/main/server-window.ts | Migrates the server picker to sim-shell: and adds main-process Escape and load-failure dismissal paths. |
| apps/desktop/src/main/ipc.ts | Replaces cwd-dependent local-file sender checks with exact bundled-page URL validation. |
| apps/desktop/e2e/packaged-smoke.spec.ts | Adds fused packaged-build coverage proving the offline page and server picker render and cross the local-page IPC gate. |
Sequence Diagram
sequenceDiagram
participant Main as Electron main process
participant Protocol as sim-shell handler
participant Page as Recovery page
participant Origin as Configured server
Main->>Protocol: load sim-shell://pages/offline.html
Protocol-->>Page: Serve allowlisted bundled HTML/font
Page->>Main: Gated shell-control IPC
Main->>Origin: Retry configured HTTP(S) origin
alt Origin recovers
Origin-->>Main: Successful main-frame load
else Origin remains unavailable
Main->>Protocol: Show offline page unless marked broken
end
Reviews (2): Last reviewed commit: "fix(desktop): keep retrying the origin p..." | Re-trigger Greptile
There was a problem hiding this comment.
1 issue found across 18 files
Confidence score: 4/5
- In
apps/desktop/scripts/build.ts, a Turbo cache hit after a clean checkout skips the copy step because onlydist/**is cached, leaving the generated font unavailable to bundled pages; include the generated font in cached outputs or ensure the copy runs on cache hits.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/desktop/scripts/build.ts">
<violation number="1" location="apps/desktop/scripts/build.ts:39">
P2: When the desktop build runs through Turbo and hits its cache after a clean checkout, this copy does not run and the generated font is not restored because Turbo only caches `dist/**`. The bundled pages then load with a missing brand font; add the font to the desktop build outputs or make it a tracked/input-derived artifact that Turbo restores.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
2cb3027 to
9e17e3f
Compare
|
@cubic-dev-ai review this PR |
@icecrasher321 I have started the AI code review. It will take a few minutes to complete. |
Summary
grantFileProtocolExtraPrivilegesfuse is off, and with it Electron no longer routesfile:navigations through its asar-aware loader, soloadFileon a page insideapp.asarfails withERR_FILE_NOT_FOUNDand the window shows only its background colour. The picker is a modal sheet whose only Cancel button lives in that page, so it could not be closed either. Unpackaged runs never hit this (no asar, default fuses), which is why the e2e suite stayed greensim-shell:scheme handled in the main process (exact-file allowlist, per-session handler), which is what Electron's fuse docs prescribe instead offile:server:/offline:IPC family on that scheme's URLs. The old gate resolvedstatic/*.htmlagainst the process cwd, which is/for a Finder-launched app, so packaged builds refused every shell-control call even when the page loadedstatic/as the only rootType of Change
Testing
sim-shell:with its font loaded, and a new test opens the picker from the offline page, checks the pre-filled value crosses the IPC gate, and closes it with Escape--remote-debugging-portto the fused build and asserts the offline page renders and the picker opens pre-filled. Passes against a localelectron-builder --mac dirbuild of this branch; fails against the shipped v0.8.19bun run lint,type-check,check:audits, and the desktop unit suite passChecklist