Skip to content

Commit 41a167d

Browse files
committed
feat(desktop): bump Electron ^33.2.1 → ^39.8.8 (CVE patches)
Covers 4 dependabot high-severity alerts (all Electron itself): - CVE-2026-34769 commandLineSwitches injection (patched 38.8.6) - CVE-2026-34770 PowerMonitor UAF (patched 38.8.6) - CVE-2026-34771 WebContents permission callback UAF (patched 38.8.6) - CVE-2026-34774 offscreen child window paint UAF (patched 39.8.1) done-verify.ts: console-message listener now handles both positional (Electron <35) and Event-object (35+) signatures. Without this the Electron 35+ runtime would silently pass an Event object in place of 'level' and the whole pre-handoff verify pipeline would stop catching browser console errors. better-sqlite3 12.9.0 postinstall auto-fetches the Electron 39 ABI prebuild; PR-A blocker from 980a217 resolved. Validated: typecheck/lint/test all green (389 tests, 10 packages); electron-builder --dir on darwin-arm64 produces a bootable .app. Stays within CLAUDE.md constraint: does NOT use Electron 41.x.
1 parent 632d5c5 commit 41a167d

3 files changed

Lines changed: 28 additions & 20 deletions

File tree

apps/desktop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@types/react-dom": "^19.0.0",
4646
"@vitejs/plugin-react": "^4.3.4",
4747
"autoprefixer": "^10.4.20",
48-
"electron": "^33.2.1",
48+
"electron": "^39.8.8",
4949
"electron-builder": "^26.8.1",
5050
"electron-builder-squirrel-windows": "26.8.1",
5151
"electron-vite": "^2.3.0",

apps/desktop/src/main/done-verify.ts

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,31 @@ export function makeRuntimeVerifier(): DoneRuntimeVerifier {
5555
type ConsoleMessageEvent = {
5656
level: 'verbose' | 'info' | 'warning' | 'error' | number;
5757
message: string;
58+
// Electron < 35 emits `line` (positional), 35+ emits an Event object
59+
// with `lineNumber`. Accept both so the listener survives the signature
60+
// change without a runtime branch at every call site.
5861
line?: number;
62+
lineNumber?: number;
5963
sourceId?: string;
6064
};
6165

62-
const onConsole = (
63-
_event: unknown,
64-
level: ConsoleMessageEvent['level'],
65-
message: string,
66-
line?: number,
67-
) => {
66+
const onConsole = (...args: unknown[]) => {
67+
// Electron 35+ emits a single Event-like object; older majors emit
68+
// positional (event, level, message, line, sourceId). Detect by
69+
// arity — a single object argument means the new shape.
70+
let level: ConsoleMessageEvent['level'];
71+
let message: string;
72+
let line: number | undefined;
73+
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null) {
74+
const e = args[0] as ConsoleMessageEvent;
75+
level = e.level;
76+
message = e.message;
77+
line = e.lineNumber ?? e.line;
78+
} else {
79+
level = args[1] as ConsoleMessageEvent['level'];
80+
message = args[2] as string;
81+
line = args[3] as number | undefined;
82+
}
6883
// Electron <26 emits a numeric level (0-3); newer builds emit a string.
6984
const isError = level === 'error' || level === 3;
7085
const isWarning = level === 'warning' || level === 2;

pnpm-lock.yaml

Lines changed: 6 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)