fix(web): Remove saved environments atomically (#2917)#117
Conversation
Co-authored-by: Julius Marminge <julius@mac.lan> Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Julius Marminge <jmarminge@gmail.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: codex <codex@users.noreply.github.com>
…dotgg#3103) Co-authored-by: codex <codex@users.noreply.github.com>
…3065) Co-authored-by: codex <codex@users.noreply.github.com>
…gg#3073) Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com> Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius@mac.lan>
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
…nc/upstream-20260619-post-connection-runtime
…nc/upstream-20260619-post-connection-runtime
…nc/upstream-20260619-post-connection-runtime
…nc/upstream-20260619-post-connection-runtime
…nc/upstream-20260619-post-connection-runtime
…nc/upstream-20260619-post-connection-runtime
…nc/upstream-20260619-post-connection-runtime
…nc/upstream-20260619-post-connection-runtime
…nc/upstream-20260619-post-connection-runtime
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55f8bd37e4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Electron.protocol.handle(input.scheme, (request) => | ||
| proxyRequest(request, input.targetOrigin, contentSecurityPolicy), |
There was a problem hiding this comment.
Register desktop schemes before handling them
When the renderer is loaded from t3code://app, this handler is installed without the previous pre-ready registerSchemesAsPrivileged call. Electron treats unprivileged custom schemes as non-standard, which disables web storage and makes resource resolution unreliable; under the new custom-origin desktop renderer this can break localStorage/IndexedDB-backed state and asset loading. Register t3code/t3code-dev as standard/secure before app.ready before calling protocol.handle.
Useful? React with 👍 / 👎.
| APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} | ||
| APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }} | ||
| MACOS_PROVISIONING_PROFILE: ${{ secrets.MACOS_PROVISIONING_PROFILE }} | ||
| T3CODE_CLERK_PASSKEY_RP_DOMAINS: ${{ vars.CLERK_PASSKEY_RP_DOMAINS }} |
There was a problem hiding this comment.
Forward the Clerk key for signed macOS releases
The signed macOS build now calls resolveMacPasskeySigningConfiguration; if the optional CLERK_PASSKEY_RP_DOMAINS repo variable is unset, that code falls back to T3CODE_CLERK_PUBLISHABLE_KEY, but this workflow does not export that key and CI has no checked-in .env. A fully configured signing run will therefore fail with the “publishable key or RP domains is required” error unless the supposedly optional RP-domain variable is also configured. Pass the publishable key here or make the RP-domain variable required.
Useful? React with 👍 / 👎.
| return Promise.resolve(null); | ||
| } | ||
|
|
||
| desktopBearerTokenPromise ??= bridge.getLocalEnvironmentBearerToken().catch((error) => { |
There was a problem hiding this comment.
Refresh cached desktop bearer tokens
This promise is cached forever after the first successful exchange, and the main-process cache stores only access_token while discarding the response expires_in. Desktop bearer sessions are expiring auth sessions, so a long-lived desktop app will keep attaching the expired token to primary-environment HTTP and WebSocket authorization until a full app restart. Cache the expiry and re-exchange or otherwise renew before expiry.
Useful? React with 👍 / 👎.
| const applicationUrl = environment.isDevelopment | ||
| ? yield* resolveDesktopDevServerUrl(environment) | ||
| : backendHttpUrl.href; | ||
| const applicationUrl = getDesktopUrl(environment.isDevelopment); |
There was a problem hiding this comment.
Reject opaque-origin renderer navigations
With the main window now loaded from t3code://app/, the existing isSameOriginRendererNavigation check compares URL.origin, which is "null" for this custom scheme in the Electron main process and also for file:/data: URLs. A renderer-initiated navigation to one of those opaque-origin URLs will therefore pass the same-origin gate instead of being blocked, whereas the previous http://127.0.0.1 application URL did not. Compare the expected scheme/host explicitly or reject opaque origins before allowing main-frame navigation.
Useful? React with 👍 / 👎.

What Changed
Why
UI Changes
Checklist