fix(desktop): browser tabs no longer log a spurious Electron sandbox error #15026
main fromrefs/pull/15026/head·opened View on GitHubProblem#
Some new browser tabs log Electron sandboxed_renderer.bundle.js script failed to run and TypeError: Cannot destructure property 'preloadScripts' of 'binding.startupData' as it is null., and preview_snapshot returns both in consoleEntries. The page works, but an agent looking for console errors reads them as the page's. It is Electron bug electron/electron#54149: browser automation attaches the debugger to a sandboxed guest before its first navigation commits, and Electron 44.4.2 runs the sandbox bundle on that initial empty document.
Change#
Bumps desktop from Electron 44.4.2 to 44.4.5. The fix (electron/electron#54155) shipped in 44.4.4; 44.4.5 is the latest 44.x patch and keeps the same Chromium 152.0.7977.130, Node 24.21.0, V8 15.2.124.28 and module ABI 149, so node-abi 4.33.0 still applies. The minimumReleaseAgeExclude entry follows the pin, and the lockfile changes only the Electron entries. The 44.4.3 to 44.4.5 release notes contain only patch fixes and upstream backports. 44.5.x is a minor release with new features and unrelated fixes, so this stays on the 44.4.x patch the triage named.
Scope and approval#
Triaged bug #13990. Julius's triage confirms the failure on de251fc and names this bump as the fix: https://github.com/pingdotgg/t3code/issues/13990#issuecomment-5859074154
Closes #13990
Verification#
- Before and after on the exact error. A standalone Electron script (below) uses the trigger from Electron's own regression test in electron/electron#54155: a sandboxed window is kept on its initial empty document, then the debugger attaches and enables
LogandRuntime, asPreviewManager.ensureControlSessiondoes. Five runs each on macOS:- 44.4.2: every run records both errors, through
console-messageandRuntime.consoleAPICalled. - 44.4.5: no run records either error. In both versions the page that commits afterwards loads and its own
console.logarrives.
- 44.4.2: every run records both errors, through
- The app still works. In a fresh worktree,
vp iinstalls 44.4.5.vp run --filter @t3tools/desktop typecheckpasses, andvp test run src/previewinapps/desktoppasses 342 tests.vp run dev:desktopboots the dev app on the 44.4.5 runtime toapp ready, with no errors in the desktop trace. - Not checked:
preview_snapshotinside the dev app itself, the packaged desktop artifact (CI builds it), and Windows or Linux. The original report is from Linux; Electron's fix is in platform-independent renderer code.
Repro script
Run with npx electron@44.4.2 main.js and npx electron@44.4.5 main.js.
// Deterministic repro for pingdotgg/t3code#13990 (electron/electron#54149),
// using the trigger from Electron's own regression test in electron/electron#54155:
// keep a sandboxed frame on its initial empty document, attach the DevTools
// protocol the way PreviewManager.ensureControlSession does, and collect what
// the debugger session and the console report.
const http = require("node:http");
const { app, BrowserWindow } = require("electron");
const PATTERN = /failed to run|startupData|sandbox_bundle/;
setTimeout(() => {
console.error("watchdog timeout");
app.exit(2);
}, 60000);
app.on("window-all-closed", () => {});
app.whenReady().then(async () => {
const server = http.createServer((req, res) => {
if (req.url === "/redirect") {
res.writeHead(302, { Location: "/page" });
res.end();
} else {
res.end("<html><body><script>console.log('page log')</script></body></html>");
}
});
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
const base = `http://127.0.0.1:${server.address().port}`;
const win = new BrowserWindow({ show: false, webPreferences: { sandbox: true } });
const wc = win.webContents;
const entries = [];
wc.on("console-message", (event) => entries.push(`console-message: ${event.message}`));
// Cancel the first navigation before it commits, so the frame stays on its
// initial empty document, which never receives startup data.
wc.once("will-redirect", (event) => event.preventDefault());
await wc.loadURL(`${base}/redirect`).catch(() => {});
wc.debugger.attach("1.3");
wc.debugger.on("message", (_event, method, params) => {
if (method === "Runtime.consoleAPICalled")
entries.push(`${method}: ${params.args.map((a) => a.value ?? a.description).join(" ")}`);
else if (method === "Runtime.exceptionThrown")
entries.push(`${method}: ${params.exceptionDetails.exception?.description ?? params.exceptionDetails.text}`);
else if (method === "Log.entryAdded") entries.push(`${method}: ${params.entry.text}`);
});
await wc.debugger.sendCommand("Log.enable");
await wc.debugger.sendCommand("Runtime.enable");
const { result } = await wc.debugger.sendCommand("Runtime.evaluate", { expression: "location.href" });
const emptyDocumentHref = result.value;
// The document that commits afterwards still loads normally.
await wc.loadURL(`${base}/page`);
await new Promise((resolve) => setTimeout(resolve, 300));
const { electron, chrome, node, v8 } = process.versions;
const spurious = entries.filter((e) => PATTERN.test(e)).map((e) => e.split("\n")[0]);
console.log(
JSON.stringify(
{
electron,
chrome,
node,
v8,
emptyDocumentHref,
spuriousErrors: spurious,
pageLogSeen: entries.some((e) => e.endsWith("page log")),
},
null,
2,
),
);
win.destroy();
server.close();
app.quit();
});
Claude Opus 5.5 via T3 Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
31f0a6aMacroscope's review found this PR approvable — This is a narrowly scoped Electron patch upgrade that fixes a documented sandbox error in existing browser-tab automation while preserving the same major/minor runtime line. The accompanying lockfile and install-policy changes are mechanical, with no new capability, schema change, deployment change, or diagnostic suppression.
Notes:
- Diff unchanged. Approvability was decided on eligibility alone.
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
- Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a8c13353-7224-41fb-91b5-8d3dbb6d61ca
📥 Commits
Reviewing files that changed from the base of the PR and between 9333509c918083cbfb7e66759ddbcbfa71a3a452 and 31f0a6a094021d08e0b40985c91dc9711e9d6e50.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
apps/desktop/package.jsonpnpm-workspace.yaml
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
📝 Walkthrough
Walkthrough#
Electron changes from version 44.4.2 to 44.4.5 in the desktop dependency and in the workspace minimum release age exclusion.
Changes#
Electron patch update
Layer / File(s) Summary Update Electron version
apps/desktop/package.json,pnpm-workspace.yamlThe desktop dependency and the minimum release age exclusion change from Electron 44.4.2 to 44.4.5. Priority: ⬇️ Low
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
juliusmarmingeMerge Risk: ⚪ Minimal · up to
31f0aThe dependency update and its lockfile and release-age configuration are aligned; no concrete merge risk remains.
Architecture Summary#
Architecture risk: 🔵 Low · up to
31f0aThe change affects 2 systems.
Changed systems:
apps/desktop,pnpm-workspace.yamlArchitecture concerns No architecture-level concerns identified.
Review details
Systems and components
- observed — apps/desktop (service) was modified; 1 changed file maps to changed impact.
- observed — pnpm-workspace.yaml (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
- observed — Modified behavior in apps/desktop/package.json: The
electrondependency version changed from44.4.2to44.4.5. - observed — Modified behavior in pnpm-workspace.yaml: The
electronversion excluded from the minimum release age changes from44.4.2to44.4.5.
🚥 Pre-merge checks | ✅ 4 | ❓ 1
❌ Failed checks (1 inconclusive)#
Check name Status Explanation Resolution Out of Scope Changes check ❓ Inconclusive The visible Electron pin and minimumReleaseAgeExcludeupdate support [#13990]. The PR description says the lockfile changes only Electron entries, butpnpm-lock.yamlis excluded by `!**/pnpm-lock.…Reviewable evidence of the pnpm-lock.yamlchanges is needed to determine whether all changes in that excluded file support the Electron update.✅ Passed checks (4 passed)
Check name Status Explanation Title check ✅ Passed The title clearly describes the main change: preventing spurious Electron sandbox errors in browser tabs. Description check ✅ Passed The description covers the problem, change, scope and approval, and verification. It also states which checks were not performed and includes a focused reproduction script. Linked Issues check ✅ Passed Issue [ #13990] expects preview console output to exclude Electron sandbox startup errors. The PR updatesapps/desktop/package.jsonfrom Electron 44.4.2 to 44.4.5, the version identified by the issue…Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0… Full details: Out of Scope Changes check
Explanation
The visible Electron pin and
minimumReleaseAgeExcludeupdate support [#13990]. The PR description says the lockfile changes only Electron entries, butpnpm-lock.yamlis excluded by!**/pnpm-lock.yamland is not represented in the change summary. I cannot verify whether that file contains unrelated changes.✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create a new PR
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment `@coderabbitai help` to get the list of available commands.juliusmarminge added labelsmacroscope-review
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge closed this
Sign in to join this conversation.
copilot-pull-request-reviewer[bot](GitHub profile, opens in a new tab) reviewed
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.