Skip to content

proposal(12): Sentry#5

Open
christian-byrne wants to merge 1 commit intoComfy-Org:mainfrom
christian-byrne:proposal/sentry
Open

proposal(12): Sentry#5
christian-byrne wants to merge 1 commit intoComfy-Org:mainfrom
christian-byrne:proposal/sentry

Conversation

@christian-byrne
Copy link

Proposal #12 — Sentry Error Tracking

Adds @sentry/electron (v7.8.0) for crash reporting and error tracking across main and renderer processes. This is error tracking only — NOT telemetry or usage analytics.

What This PR Does

  1. lib/sentry.js — New module that initializes Sentry only when the user has opted in via settings. Uses beforeSend to scrub filesystem paths for privacy.
  2. main.js — Requires lib/sentry.js as the very first line (before app.whenReady()) so unhandled errors are captured from startup.
  3. lib/ipc.js — Adds errorReporting toggle to Settings → General (line 449), using the existing boolean field renderer.
  4. locales/en.json / zh.json — Adds i18n key: "Send anonymous error reports (requires restart)".
  5. package.json — Adds @sentry/electron dependency.
  6. .github/proposals/proposal-sentry.md — Full migration proposal with architecture, privacy analysis, compatibility, bundle size, and phased rollout plan.

Key Design Decisions

  • Off by defaulterrorReporting defaults to false. Sentry.init() is never called unless the user explicitly enables it.
  • Privacy-firstsendDefaultPii: false, tracesSampleRate: 0, beforeSend strips absolute filesystem paths from error messages.
  • No bundler required — SDK ships CJS entry points; works with the current plain-script architecture.
  • Placeholder DSN — Uses https://examplePublicKey@o0.ingest.sentry.io/0. Must be replaced with a real DSN before shipping.
  • Electron v40 compatible — SDK supports electron >= v23.

What IS / IS NOT Collected

Collected (when enabled) NOT collected
Stack traces from unhandled errors ❌ No usage analytics or telemetry
Electron/OS version, architecture ❌ No user-identifiable information
Breadcrumbs (console, navigation) ❌ No filesystem paths (scrubbed)
App version for release tracking ❌ No workflow data or model names

Bundle Size

~1–2 MB added to asar — negligible vs Electron baseline (~150+ MB). No native modules.

Dependencies

None (independent proposal). Benefits from Proposal #1 (electron-vite) for future source map uploads.

Files Changed

File Change
lib/sentry.js New — Sentry init with opt-in guard and path scrubbing
main.js +1 line: require("./lib/sentry")
lib/ipc.js +1 line: errorReporting toggle in settings
locales/en.json +1 key
locales/zh.json +1 key
package.json +1 dependency
.github/proposals/proposal-sentry.md Full proposal document

Add @sentry/electron for crash reporting and error tracking across main
and renderer processes. Error reporting is off by default and controlled
via a user-facing toggle in Settings → General.

- Add lib/sentry.js: Sentry initialization guarded by errorReporting setting
- Add require('./lib/sentry') as first line of main.js
- Add errorReporting boolean toggle to settings sections in lib/ipc.js
- Add i18n keys for en.json and zh.json
- Add @sentry/electron dependency
- Add proposal document at .github/proposals/proposal-sentry.md

Privacy: beforeSend scrubs filesystem paths. No PII, no telemetry,
no usage analytics. Only unhandled errors are captured when enabled.

Amp-Thread-ID: https://ampcode.com/threads/T-019c7926-be08-704f-b583-1c5167315271
Kosinkadink added a commit that referenced this pull request Feb 22, 2026
Migrate renderer from 15 vanilla JS files to Vue 3 + Pinia + Tailwind CSS 4:
- Typed IPC bridge (30+ methods) in src/preload/
- Pinia stores: sessionStore (running instances, terminals), installationStore
- Promise-based modal system (useModal + ModalDialog)
- 9 views and 7 reusable components with Composition API
- vue-i18n runtime locale loading
- Tailwind CSS 4 with design tokens extracted from old styles.css

Code review fixes applied:
- Fix runtime  crash: use useI18n() in script setup (#1, #2)
- Fix unsafe spread on non-array SettingsField values (#3)
- Replace document.getElementById with reactive state in NewInstallModal (#4)
- Use DetailSection component in DetailModal, removing 130 lines of duplication (#5)
- Replace v-html/metaHtml with structured #meta slot and MetaPart arrays (#6)
- Emit setting-updated from SettingField, SettingsView re-fetches on change (#7)
- Eliminate prop mutations in DetailModal, use update:installation emit (#8)

Amp-Thread-ID: https://ampcode.com/threads/T-019c840f-eaa4-771e-bb7f-a27118c0e3eb
Co-authored-by: Amp <amp@ampcode.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant