fix(desktop): bridge renderer errors to main Sentry SDK#643
Merged
jeevanpillay merged 2 commits intomainfrom May 6, 2026
Merged
fix(desktop): bridge renderer errors to main Sentry SDK#643jeevanpillay merged 2 commits intomainfrom
jeevanpillay merged 2 commits intomainfrom
Conversation
The renderer-side `@sentry/electron/renderer` path silently failed to register a client in the v10 carrier — `Sentry.init()` was a no-op, so captured events never reached the IPC transport regardless of the CSP or preload bridge wiring. Org-level stats showed zero ingestion across rc.1, rc.2, and rc.3 despite the rest of the observability hardening landing cleanly. Forward `IpcChannels.rendererError` payloads to `Sentry.captureException` on the main process, where `@sentry/electron/main` is fully working. Preserve the renderer stack so debug-id-paired sourcemaps still symbolicate, and tag events with `bundle: "renderer"` to keep them distinguishable from main-process exceptions. Drop the dead renderer/preload Sentry plumbing and the v10 deps it pulled in (`@sentry/browser`, `@sentry-internal/*`, `@sentry/node`, `@sentry/core`). Renderer bundle drops from ~525K to 421K; preload shrinks to 2.5K. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Contributor
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughSentry initialization is centralized in the Electron main process using ChangesSentry Main-Process Centralization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
Import order + line-length fixes flagged by CI Biome check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 6, 2026
jeevanpillay
added a commit
that referenced
this pull request
May 6, 2026
CodeRabbit flagged the renderer comment recommending `@sentry/electron/renderer` as a direct third-party SDK reference, which violates repo policy. Same policy violation in apps/desktop/src/main/index.ts where PR #643 added a direct `import * as Sentry from "@sentry/electron/main"` instead of routing through the existing `@vendor/observability/sentry-electron-main` re-export (which already exposes captureException). - Switch main/index.ts to import { captureException } from the vendor wrap. - Update the renderer comment to point at a hypothetical `@vendor/observability/sentry-electron-renderer` re-export rather than the underlying `@sentry/electron/renderer` SDK. - Mirror the same guidance in the dry-run report's §Correction follow-ups. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@sentry/electron/renderersilently fails to register a client in the v10 carrier —Sentry.init()is a no-op, so events captured in the renderer never reached the IPC transport. Org-level Sentry stats show zero ingestion across rc.1, rc.2, rc.3 despite all the observability hardening from fix(desktop): observability hardening — IPC routing + debug-id symbolication #641/fix(desktop): create Sentry release before finalize #642 landing cleanly.IpcChannels.rendererErrorpayloads toSentry.captureExceptionon the main process, where@sentry/electron/mainis fully working. Preserve the renderer stack so debug-id sourcemaps still symbolicate, tag events withbundle: "renderer"to keep them distinguishable from main exceptions.@sentry/electron/preloadIPC bridge,getSentryInitOptionsSyncchannel,sentryInitbridge field) and the v10 deps it pulled in:@sentry/browser,@sentry-internal/{browser-utils,feedback,replay,replay-canvas},@sentry/node,@sentry/core. Renderer bundle drops from ~525K → 421K; preload shrinks to 2.5K.Why this is the fix
The previous PR (#641) wired the IPC bridge correctly —
__SENTRY_IPC__was exposed, no more CSP fetch errors — but__SENTRY__["10.47.0"]showedclientPresent: false,defaultClient: null, noacskey. Multiple investigations confirmed the renderer SDK loaded, butSentry.initnever registered a client. Bridging through main bypasses the broken renderer SDK entirely while keeping the user-facing pipeline (installErrorBoundary+lightfastBridge.reportError) unchanged.Test plan
sentryInitreads anywhere)@lightfast/desktop@0.1.0-rc.4after merge, confirm workflow is green and 6 assets uploadedopen -a Lightfastafter quarantine clear, then trigger uncaught throw via CDP--remote-debugging-port=9222→ verify Sentry receives an issue withbundle:renderertag and a symbolicated stack pointing into source files (not minified bundle).bundle:electron host:apptags arrive too.🤖 Generated with Claude Code
Summary by CodeRabbit