Commit e3c49ef
authored
Desktop crash reporting + diagnostics export (#961)
* Add crash reporting and one-click diagnostics export to the desktop app
- Sentry in the Electron main process, gated on a DSN baked in at build
time (SENTRY_DSN env -> define). No DSN (local/dev/fork builds) means
nothing is ever sent; native crash dumps are still written locally via
crashReporter for the diagnostics export.
- Sidecar stdout/stderr now persist to main.log under a 'sidecar' scope
(previously terminal-only, so server crashes left no trace on disk).
Unexpected sidecar exits after a successful boot are logged and
reported with a bounded stderr tail.
- render-process-gone / child-process-gone are logged locally and
captured upstream; main-process uncaught errors land in main.log.
- Export Diagnostics: app menu item + Settings-page button pack a
redacted manifest (version, OS, paths, port - never passwords or
~/.executor data), recent logs, and crash dumps into a zip in
Downloads and reveal it in the file manager.
- publish-desktop.yml passes vars.SENTRY_DSN into the electron-vite
build step.
* Extend desktop crash reporting to renderer and sidecar, add Report a Problem
- Renderer: the shared web bundle initializes browser error reporting
only when the desktop preload bridge hands it a DSN at runtime —
nothing is baked into the bundle, so executor web / self-host / cloud
stay inert. Handled UI errors already route through reportError and
are picked up by the global handlers.
- Sidecar: env-gated init in the sidecar entry (DSN passed by the main
process, desktop-with-DSN builds only). Captures uncaught exceptions
and unhandled rejections in the server process. The CLI never sets
the env vars, keeping executor web telemetry-free.
- One runId per launch tags events from all three processes and is
stamped into the diagnostics-zip manifest, so a user-sent zip and its
Sentry events can be cross-referenced.
- electron-log lines become Sentry breadcrumbs (file transport hook),
so events arrive with recent log context.
- 'Report a Problem…' menu item exports the diagnostics zip and opens
a prefilled GitHub issue (version, OS, runId).
Verified against a local fake ingest server: session/event envelopes
received from all three SDKs (browser on boot, electron on forced
sidecar SIGKILL with breadcrumbs attached, bun on forced bind failure).
Compiled-sidecar smoke test passes with @sentry/bun bundled.
* Honor DO_NOT_TRACK, add sidecar crash screen, prove the flow on camera
- DO_NOT_TRACK=1 (or true) disables crash reporting in all three
processes — checked once in the main process, which is the single
source of the renderer's and sidecar's reporting config.
- When the sidecar dies under a live window the app now swaps the dead
web UI for an in-window crash screen (data: URL, preload bridge
intact) with Restart server / Export diagnostics actions. Restart
drives the existing sidecar restart IPC and reloads the console.
- New e2e desktop target + scenario: launches the real Electron app in
a throwaway HOME via Playwright's electron driver, SIGKILLs the
sidecar, asserts the crash screen, recovers via its Restart button,
and asserts the healed sidecar is a new pid. Produces session.mp4 +
per-step screenshots under e2e/runs/desktop/. Run with
`npm run test:desktop` in e2e/ (needs a display).
* Rename the desktop crash-report DSN variable to DESKTOP_SENTRY_DSN
Repo-level SENTRY_DSN was ambiguous next to cloud's own Sentry config;
the variable now names its surface.
* Crash screen can check for updates
A recurring sidecar crash may already be fixed upstream — the crash
screen gets a Check for updates button (reuses the menu update flow),
and showing the screen quietly stages any available update so the
install prompt appears on its own, mirroring the fatal-startup
self-heal.1 parent 7162793 commit e3c49ef
21 files changed
Lines changed: 1015 additions & 9 deletions
File tree
- .github/workflows
- apps/desktop
- src
- main
- preload
- sidecar
- e2e
- desktop
- setup
- targets
- packages
- app
- src
- plugins/desktop-settings/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
110 | 115 | | |
111 | 116 | | |
112 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
0 commit comments