Skip to content

fix(web): Remove saved environments atomically (#2917)#117

Merged
aaditagrawal merged 30 commits into
mainfrom
sync/upstream-20260619-post-connection-runtime
Jun 24, 2026
Merged

fix(web): Remove saved environments atomically (#2917)#117
aaditagrawal merged 30 commits into
mainfrom
sync/upstream-20260619-post-connection-runtime

Conversation

@aaditagrawal

Copy link
Copy Markdown
Owner

What Changed

Why

UI Changes

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

mwolson and others added 19 commits June 18, 2026 20:20
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>
…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>
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4018a4a1-502a-409c-9d3f-8fdfbd4ef362

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/upstream-20260619-post-connection-runtime

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@aaditagrawal
aaditagrawal marked this pull request as ready for review June 24, 2026 08:45
@aaditagrawal
aaditagrawal changed the base branch from sync/upstream-20260618-connection-architecture to main June 24, 2026 08:53
@aaditagrawal
aaditagrawal merged commit 179dd20 into main Jun 24, 2026
26 of 28 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +129 to +130
Electron.protocol.handle(input.scheme, (request) =>
proxyRequest(request, input.targetOrigin, contentSecurityPolicy),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants