mirror of
https://github.com/stablyai/orca.git
synced 2026-10-21 08:03:33 +00:00
* fix(crash-reporting): disambiguate main process relaunches * fix(crash-reporting): trace all app relaunch causes
18 lines
680 B
TypeScript
18 lines
680 B
TypeScript
import { app } from 'electron'
|
|
import type { CrashReportBreadcrumbData } from '../shared/crash-reporting'
|
|
import { recordDurableCrashBreadcrumb } from './crash-reporting/durable-crash-breadcrumb'
|
|
|
|
export type AppRelaunchReason =
|
|
| 'admin-restart'
|
|
| 'gpu-fallback'
|
|
| 'profile-switch'
|
|
| 'profile-transfer'
|
|
| 'renderer-request'
|
|
|
|
export function relaunchApp(reason: AppRelaunchReason, data?: CrashReportBreadcrumbData): void {
|
|
// Why: the current process can exit immediately after app.relaunch(), so
|
|
// persist the cause before Electron schedules the replacement process.
|
|
recordDurableCrashBreadcrumb('app_relaunch_requested', { ...data, reason })
|
|
app.relaunch()
|
|
}
|