Skip to content

perf(issues): Skip source-map-debug request when no frame can be unminified - #130615

Merged
lcian merged 2 commits into
masterfrom
fix/skip-source-map-debug-without-minified-frames
Nov 12, 2026
Merged

lcian merged 2 commits into
masterfrom
fix/skip-source-map-debug-without-minified-frames

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

The issue page calls GET /projects/{org}/{project}/events/{eventId}/source-map-debug/ for every sentry.javascript.* event when the Stack Trace section renders. It does this even when no frame can show the "Unminify Code" button. In that case, the user cannot open the source map debugger modal, which is the only way to show the data we just fetched, so the call is not necessary.

This endpoint is expensive. In the last 7 days it had about 287k requests, with a frontend p95 of 1.5s and a backend p99 of 4.1s at about 27 DB queries per request.

This PR has two commits:

  1. ref: Replace useSourceMapDebugQuery with sourceMapDebugApiOptions, which follows the established apiOptions + skipToken frontend pattern. No behavior change.
  2. perf: Do the per-frame button checks (no source context, in-app, supported file extension, debugger not hidden) before the query, and pass skipToken when they fail. The request now runs only when at least one frame can show the button.

via @lcian.

--

View Session [Sentry]

@sentry-junior
sentry-junior Bot requested review from a team as code owners November 10, 2026 14:44
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 10, 2026
…ions

Follow the frontend data-fetching guidance: build on apiOptions, not
useQuery, and disable queries with skipToken. The source map issue page
now uses the same options instead of its own inline copy. No behavior
change.

Co-Authored-By: Lorenzo Cian <17258265+lcian@users.noreply.github.com>
@sentry-junior
sentry-junior Bot force-pushed the fix/skip-source-map-debug-without-minified-frames branch from 21e69c0 to b50ed2a Compare November 10, 2026 15:05
@lcian
lcian enabled auto-merge (squash) November 12, 2026 10:38
auto-merge was automatically disabled November 12, 2026 10:39

Head branch was modified

@lcian
lcian enabled auto-merge (squash) November 12, 2026 10:40
auto-merge was automatically disabled November 12, 2026 10:40

Head branch was modified

…nified

The issue stack trace fetched source-map-debug for every JavaScript SDK
event, even when no frame could show the Unminify Code button. Pass
skipToken unless the frame passes the local button checks. The query is
shared, so it still runs once when any frame is eligible.

Co-Authored-By: Lorenzo Cian <17258265+lcian@users.noreply.github.com>
@sentry-junior
sentry-junior Bot force-pushed the fix/skip-source-map-debug-without-minified-frames branch from 545290e to 15ab063 Compare November 12, 2026 10:41
@lcian
lcian merged commit 517d004 into master Nov 12, 2026
84 checks passed
@lcian
lcian deleted the fix/skip-source-map-debug-without-minified-frames branch November 12, 2026 10:51

This branch was successfully deployed

1 active deployment
Preview — 15ab0631 Deployed Nov 12, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant