(error: unknown)
| 916 | // here, the boot-time update check never runs (it sits after a successful |
| 917 | // sidecar start), so a broken app could never self-update its way out. |
| 918 | const handleFatalSidecarFailure = async (error: unknown) => { |
| 919 | if (app.isPackaged) { |
| 920 | // Install whatever finishes downloading by the time the user quits the |
| 921 | // failure dialog; if it downloads while the dialog is open, the regular |
| 922 | // 'update-downloaded' prompt offers an immediate restart instead. |
| 923 | autoUpdater.autoInstallOnAppQuit = true; |
| 924 | void runUpdateCheck({ alertOnFail: false }); |
| 925 | } |
| 926 | // oxlint-disable-next-line executor/no-instanceof-error, executor/no-unknown-error-message -- boundary: sidecar startup failures arrive as plain Node errors and render in a native dialog |
| 927 | const detail = error instanceof Error ? (error.stack ?? error.message) : String(error); |
| 928 | const { response } = await dialog.showMessageBox({ |
| 929 | type: "error", |
| 930 | title: "Executor failed to start", |
| 931 | message: "The local Executor server crashed during startup.", |
| 932 | detail: `${detail.slice(0, 1800)}\n\nFull log: ${log.transports.file.getFile().path}`, |
| 933 | buttons: ["Quit", "Reset data and retry…"], |
| 934 | defaultId: 0, |
| 935 | cancelId: 0, |
| 936 | }); |
| 937 | // Damaged executor state (failed migration, corrupt SQLite) makes startup |
| 938 | // fail forever — updating can't fix it. Offer the move-aside reset and one |
| 939 | // immediate retry. Returns true when boot should be attempted again. |
| 940 | if (response === 1 && (await confirmResetState())) { |
| 941 | const { backupDir } = resetExecutorState(); |
| 942 | await announceBackup(backupDir); |
| 943 | return true; |
| 944 | } |
| 945 | return false; |
| 946 | }; |
| 947 | |
| 948 | const installApplicationMenu = () => { |
| 949 | const isMac = process.platform === "darwin"; |
no test coverage detected