Skip to content

fix(sentry): attribute renderer and native crashes - #404

Merged
SDSLeon merged 2 commits into
masterfrom
poracode/sentry-renderer-native
Jul 27, 2026
Merged

fix(sentry): attribute renderer and native crashes#404
SDSLeon merged 2 commits into
masterfrom
poracode/sentry-renderer-native

Conversation

@SDSLeon

@SDSLeon SDSLeon commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Sync renderer Sentry runtime tags from the focused visible thread, including provider, presentation, and runtime kind, and explicitly clear stale tags on home/draft/unmount transitions.
  • Preserve React crash structure as a privacy-safe poracode context containing only validated component names; file paths, props, prompts, and user text are never attached.
  • Normalize main, quick-composer, and browser renderer process-gone events into stable OS/reason fingerprints. Per-window close/reload intent is supplied at the capture sites, prevented close-to-tray events do not count as closes, reload intent is one-shot, and unproven kills remain visible.
  • Classify native GPU fatals and OOMs into stable OS/reason fingerprints while narrowly dropping only minidumps whose native/unknown process plus Crashpad stack annotation proves the executable is Xcode's external swift-frontend.
  • Drop the audited xterm clipboard focus race only when the raw renderer exception has both type NotAllowedError and the exact unfocused-document Clipboard.writeText message; other clipboard, security, and NotAllowedError failures remain reportable.
  • Drop the exact main-process net::ERR_NETWORK_CHANGED transient and handled file-editor stale-file outcomes at their raw-event boundaries. Other network errors, generic ENOENT failures, other feature areas, and unhandled file errors remain reportable.

Sentry issues and treatment

  • LIGHTCODE-59 / LIGHTCODE-4G — real Electron GPU/native fatals. Preserved as fatal errors and grouped by OS plus gpu-fatal; no macOS/native or GPU suppression was added.
  • LIGHTCODE-5T — external child-process pollution. Filtered only when the minidump is native, event.process is unknown, and the Crashpad Program arguments line identifies /Applications/Xcode.app/.../usr/bin/swift-frontend. Generic Swift assertion failures and unknown macOS native crashes remain reportable.
  • LIGHTCODE-49 — expected xterm clipboard focus race. Dropped in renderer beforeSend, before sanitization, only for the audited exception type/message pair. Nearby permission, security, and clipboard failures remain captured.
  • LIGHTCODE-1R — transient Electron network transition. Dropped in main beforeSend only when the raw event message or exception value is exactly net::ERR_NETWORK_CHANGED; related and prefixed network failures remain captured.
  • LIGHTCODE-5J — expected stale external file. Dropped in renderer beforeSend only when poracode.feature_area=file-editor, the exception mechanism is explicitly handled, and the value matches ^File not found: .+$. The UI error path is unchanged.
  • Renderer process-gone noise is treated contextually: clean-exit is ignored, killed is ignored only with explicit app-shutdown/reload/window-close intent, and crashed/OOM/integrity/launch/abnormal/unknown paths stay reportable with stable fingerprints.

Privacy and architecture

  • No project, thread, user, command, path, prompt, repository, auth, or content values are added to telemetry.
  • React component context admits only bounded structural component identifiers.
  • Existing zero-PII, zero-screenshot, and breadcrumb restrictions are unchanged.
  • Provider behavior remains data-driven; shared Sentry privacy/classification code and tag allowlists were not edited, so this PR builds independently against master.

Validation

  • pnpm exec vitest run src/main/diagnostics/mainEvent.test.ts src/main/diagnostics/nativeCrash.test.ts src/main/diagnostics/processGone.test.ts src/main/window/windowHardening.test.ts src/main/window/createMainWindow.test.ts src/main/window/createQuickComposerWindow.test.ts src/renderer/diagnostics/sentry.test.ts src/renderer/diagnostics/runtimeContext.test.ts src/renderer/RendererCrashScreen.test.tsx — 9 files / 45 tests passed.
  • pnpm run typecheck — passed.
  • pnpm run lint — passed.
  • pnpm run fmt:check — passed.
  • pnpm run test — 631 files / 6,605 tests passed; two native DB fixture suites raced while concurrently rebuilding the same ignored dist/server-native directory. Both were rerun sequentially and passed (projectsThreads: 10, tokenStats: 4).

Residual risk

  • The external-child filter intentionally recognizes only the audited canonical Xcode executable path. Other toolchain/install layouts remain visible rather than risking a false-positive suppression.
  • Renderer killed events without an explicit lifecycle intent remain visible as unexpected-kill, favoring detection over noise suppression.

@SDSLeon
SDSLeon force-pushed the poracode/sentry-renderer-native branch from 5f69845 to 8db81cb Compare July 27, 2026 20:00
@SDSLeon
SDSLeon force-pushed the poracode/sentry-renderer-native branch from 8db81cb to 261be0a Compare July 27, 2026 20:03
@SDSLeon
SDSLeon merged commit b061882 into master Jul 27, 2026
8 checks passed
@SDSLeon
SDSLeon deleted the poracode/sentry-renderer-native branch July 27, 2026 20:52
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