mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 08:03:39 +00:00
* fix(crash-reporting): disambiguate main process relaunches * fix(crash-reporting): trace all app relaunch causes
15 lines
729 B
TypeScript
15 lines
729 B
TypeScript
import type { CrashReportBreadcrumbData } from '../shared/crash-reporting'
|
|
import { recordDurableCrashBreadcrumb } from './crash-reporting/durable-crash-breadcrumb'
|
|
|
|
export function recordUpdaterLifecycle(
|
|
event: string,
|
|
data?: CrashReportBreadcrumbData,
|
|
options?: { level?: 'info' | 'warn' | 'error'; message?: string }
|
|
): void {
|
|
// Why: update-driven relaunches must remain visible in the same durable lane
|
|
// as renderer recovery so support traces can distinguish their lifecycles.
|
|
recordDurableCrashBreadcrumb(`updater_${event}`, data)
|
|
const suffix = data && Object.keys(data).length > 0 ? ` ${JSON.stringify(data)}` : ''
|
|
console[options?.level ?? 'info'](`[updater] ${options?.message ?? event}${suffix}`)
|
|
}
|