Skip to content

revert(desktop): drop the renderer heap-trajectory Sentry instrumentation - #6499

Merged
saddlepaddle merged 1 commit into
mainfrom
sentry/revert-renderer-oom-context
Aug 15, 2026
Merged

saddlepaddle merged 1 commit into
mainfrom
sentry/revert-renderer-oom-context

Conversation

@saddlepaddle

@saddlepaddle saddlepaddle commented Aug 15, 2026 •

Copy link
Copy Markdown
Member

Problem

#6496 added a permanent renderer heap sampler and a Sentry scope trajectory to make two OOM minidumps (DESKTOP-Y3, DESKTOP-Y8) diagnosable. On review after merge, it does not clear the bar for permanently maintained code.

Why it is being reverted

The mechanism was correct — renderer setTag/setExtra genuinely do reach a minidump, and contexts genuinely would not — so this is not a revert for being broken. It is a revert for not being worth its keep:

  • Two events justified it. One occurrence each, on 1.20.2, on different platforms. That is not a demonstrated recurring family; it is two data points that happened to land on the same day.
  • It is permanent. A 5-minute interval for the life of every renderer, plus a tag on every renderer event, with no removal condition and nobody owning its retirement. Instrumentation added speculatively tends to stay forever.
  • The sample interval is incoherent with its own source. performance.memory is quantized and refreshed far more coarsely than 5 minutes without --enable-precise-memory-info, which we deliberately do not set. Early history therefore carries repeated identical readings. The stride-doubling self-corrects on multi-day sessions, but the chosen interval buys nothing over a much cheaper one.
  • The non-trivial logic is untested. recordHeapSample's halving decimation and summarizeHeap's growth-rate maths shipped with no unit tests.
  • It cannot capture the failure it was partly aimed at. DESKTOP-Y8 is a PartitionAlloc commit failure inside a single JSON.stringify, not JS-heap accumulation. A 5-minute sampler of usedJSHeapSize cannot see that spike.

What is kept

Nothing is lost by reverting. The findings that came out of the work are recorded outside the code:

  • Renderer Sentry scope reaches native crash reports only via tags/extra/user/attachments/breadcrumbs; setContext is dropped by handleScope in @sentry/electron 7.16.0. Anyone adding renderer enrichment later needs this and should not rediscover it.
  • DESKTOP-Y3 and DESKTOP-Y8 are two different causes, not one family: a slow retainer over ~75h uptime versus a single enormous serialization in ~5h.
  • Chromium already ships v8-oom-* crash keys for V8 heap-limit aborts (Y3 has them), and none for PartitionAlloc aborts (Y8 has none). Uptime is already derivable from app.app_start_time.
  • Unverified hypothesis worth pursuing on its own merits, code untouched: since feat(desktop,mobile,trpc): replace Electric sync with plain tRPC + React Query #6328 every renderer TanStack DB collection is localStorage-backed, and a localStorage collection re-serializes the whole org blob per mutation — which fits both crash shapes.

If this family recurs at volume, the right move is to fix the retainer, not to instrument around it.

Verification

Refs DESKTOP-Y3
Refs DESKTOP-Y8


Summary by cubic

Reverts the renderer heap-trajectory Sentry instrumentation from #6496 to remove a permanent 5-minute heap sampler and scope tags/extras that don’t meet our bar for long-term maintenance or diagnosability.

  • Deletes apps/desktop/src/renderer/lib/heap-trajectory.ts and removes the sampler from apps/desktop/src/renderer/lib/sentry.ts.
  • Restores pre-fix(desktop): carry a renderer heap-growth trajectory on the Sentry scope #6496 behavior: no renderer_heap extra, no renderer.heap_used tag, and no periodic performance.memory reads.
  • Reduces renderer overhead; crash reports rely on Chromium v8-oom-* keys as before.

Written for commit 733de5c. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Removed Features
    • Removed heap usage tracking and trajectory reporting from the desktop application.
    • Sentry initialization no longer starts background heap monitoring.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fabc90db-7bc2-4437-a40b-a2e4e19b5a0f

📥 Commits

Reviewing files that changed from the base of the PR and between 1dceb5a and 733de5c.

📒 Files selected for processing (2)
  • apps/desktop/src/renderer/lib/heap-trajectory.ts
  • apps/desktop/src/renderer/lib/sentry.ts
💤 Files with no reviewable changes (2)
  • apps/desktop/src/renderer/lib/heap-trajectory.ts
  • apps/desktop/src/renderer/lib/sentry.ts

📝 Walkthrough

Walkthrough

The PR removes heap trajectory types and utilities. Sentry initialization no longer starts renderer heap sampling.

Changes

Renderer heap tracking removal

Layer / File(s) Summary
Remove heap tracking implementation and wiring
apps/desktop/src/renderer/lib/heap-trajectory.ts, apps/desktop/src/renderer/lib/sentry.ts
Removes heap trajectory declarations and utilities. Removes the Sentry initialization call that started heap tracking.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 733de

This PR removes the permanent renderer heap trajectory instrumentation and restores the prior behavior; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title uses conventional commit format and clearly identifies the removal of renderer heap-trajectory Sentry instrumentation.
Description check ✅ Passed The description clearly explains the rationale, scope, retained findings, and verification steps, although it omits the template checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sentry/revert-renderer-oom-context

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@saddlepaddle
saddlepaddle merged commit a02341e into main Aug 15, 2026
12 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch

Thank you for your contribution! 🎉

@saddlepaddle
saddlepaddle deleted the sentry/revert-renderer-oom-context branch August 15, 2026 18:31
@Kitenite Kitenite mentioned this pull request Aug 16, 2026
3 tasks done
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