Skip to content

fix(replays): Prevent Memory panel crashes from missing data - #131004

Merged
gggritso merged 7 commits into
masterfrom
seer/fix-replay-memory-chart-undefined
Nov 19, 2026
Merged

gggritso merged 7 commits into
masterfrom
seer/fix-replay-memory-chart-undefined

Conversation

@sentry

@sentry sentry Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

The Memory panel crashed with Cannot read properties of undefined (reading 'usedJSHeapSize') when a recording had a memory span whose data existed but had no memory key. This PR adds some error-checking there.

The SDK always sends data.memory, and Relay recording scrubbing only rewrites strings, so the malformed span most likely came from client-side changes to the recording, such as beforeAddRecordingEvent. That cause isn't confirmed.

Fixes REPLAY-1047

Fixes JAVASCRIPT-3GBY

via George Gritsouk.

--

View Session [Sentry]

@sentry
sentry Bot requested a review from a team as a code owner November 12, 2026 22:52
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

✅ no issues found

The memory chart now only receives frames whose usedJSHeapSize is a finite number, and MemoryFrame's type requires data, so the chart no longer needs its own guard. Frames like {memory: {}} previously passed the filter and charted undefined points.

Refs REPLAY-1047

Co-Authored-By: George Gritsouk <[email protected]>
@sentry-junior sentry-junior Bot changed the title fix(replays): Guard memory chart against missing memory data fix(replays): Only chart memory frames with a numeric heap size Nov 17, 2026
@linear-code

linear-code Bot commented Nov 17, 2026

Copy link
Copy Markdown

REPLAY-1047

@gggritso gggritso changed the title fix(replays): Only chart memory frames with a numeric heap size fix(replays): Prevent Memory panel crashes from missing data Nov 17, 2026

@gggritso gggritso left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we maybe add some kind of UI warning that some memory frames were invalid? Is there precedent for that in the Replay UI and specifically in the Memory panel, or any other panels?

@sentry-junior

sentry-junior Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Re: a UI warning for invalid memory frames. I didn't find precedent for an "N frames were invalid" warning anywhere in the Replay UI:

  • fix(replays): Handle replay frames without data or payload #128517 dropped breadcrumbs with no payload and quietly degraded spans with missing data. In both cases it only logged a warning (Replay: dropped breadcrumb frames without a payload, Replay: span frames are missing data), with nothing shown in the UI.
  • The closest UI precedent is per row in the Network details panel: Invalid JSON for a body that won't parse, Missing request details, and the setup warnings when bodies weren't captured. Those describe one selected request. They don't count dropped data.
  • The Memory panel only has the "No memory metrics found" empty state. With this PR, that's what shows when every memory frame is invalid.

So this PR keeps the existing pattern: drop the bad frames and log them. A partial-data warning could make sense, but it would be a new UX pattern across replay panels, and the crash has 1 event so far. I'd leave it for a follow-up if we want it. Your call.

Copy link
Copy Markdown
Member

@cursor review

@gggritso gggritso added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Nov 17, 2026 — with Linear Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d6fe189. Configure here.

@github-actions github-actions Bot removed the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Nov 18, 2026
@gggritso gggritso added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Nov 19, 2026 — with Linear Code
@github-actions github-actions Bot removed the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Nov 19, 2026
@gggritso gggritso added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Nov 19, 2026
…ory-chart-undefined

Co-Authored-By: George Gritsouk <[email protected]>

# Conflicts:
#	static/app/utils/replays/hydrateSpans.tsx
@github-actions github-actions Bot removed the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Nov 19, 2026
@gggritso gggritso added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Nov 19, 2026
@github-actions github-actions Bot removed the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Nov 19, 2026
@gggritso gggritso added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Nov 19, 2026
@gggritso gggritso added the Trigger: Override Selective Testing Run the full test suite; necessary in cases where selected tests are flaky due to reshuffling label Nov 19, 2026 — with Linear Code
@gggritso
gggritso merged commit 1ee71dd into master Nov 19, 2026
138 of 140 checks passed
@gggritso
gggritso deleted the seer/fix-replay-memory-chart-undefined branch November 19, 2026 20:25
joshuarli added a commit that referenced this pull request Nov 19, 2026
Since #131408, a label event other than `Trigger: Override Selective
Testing` starts an acceptance run where every job skips and the
aggregator reports as `Acceptance (ignored label event)`. If that run is
the newest acceptance run on a commit, the merge box keeps waiting for
the required `Acceptance` check, even though an older run on the same
commit passed. Re-running the older run doesn't help, because it is
still not the newest run.

This hits PRs where a person adds a label after the last push. The
common case is Seer and bot PRs that need `Trigger: getsentry tests`
added again after each push. #131004, reported by @gggritso, is one
example: `Acceptance` passed twice on its head commit, the PR is
approved, and it still shows as blocked. #131456 shows the same pattern.

This change handles label events the way `backend.yml` already does:
- They share the PR's concurrency group.
- They run selective acceptance as usual.
- They report `Acceptance`.

The override label keeps working, because `skip_selective_testing` still
reads the PR's labels.

Trade-off: each manual label added to a PR now starts a selective
acceptance run and cancels any run in progress, just like backend.
#131408 used the ignored-label path to avoid that cost.

Open question: the claim that the merge box only counts the newest run
per workflow is inferred from the check and merge state of the PRs
above, not from GitHub docs.

Refs DI-2885

<!-- junior-request-attribution:start -->
via @joshuarli.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3ACTJL7358X%3A1795105768.817939 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/slack%3ACTJL7358X%3A1795105768.817939)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3ACTJL7358X%3A1795105768.817939/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Joshua Li <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 8b0d0e55 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests Trigger: Override Selective Testing Run the full test suite; necessary in cases where selected tests are flaky due to reshuffling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants