Repository navigation
Source maps phase 4: stack symbolication - #124
Conversation
23578f6 to
e6b79e4
Compare
| } | ||
| return { ...occ, symbolicated_stack: symbolicated }; | ||
| }) | ||
| ); |
There was a problem hiding this comment.
Top stack frame race
Medium Severity
symbolicated_top_stack is filled inside concurrent Promise.all workers via a shared symbolicatedTop flag, so whichever occurrence finishes first after awaiting maps can win—not necessarily the newest row. Docs require the first symbolicated frame from the newest occurrence stack only, and when that stack does not resolve the field should stay unset rather than falling back to an older occurrence.
Reviewed by Cursor Bugbot for commit c729d7f. Configure here.
c729d7f to
bf3e3a9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
There are 3 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bf3e3a9. Configure here.
| } | ||
| } | ||
|
|
||
| if (frame.endsWith(bundle) || bundle.endsWith(frame)) return true; |
There was a problem hiding this comment.
Cross-host match relative bundle URL
Medium Severity
When an artifact’s bundle_url has no scheme (e.g. app.js), frameMatchesBundle can match a full https://…/app.js frame via frame.endsWith(bundle) without comparing origins, contradicting the PR’s goal of avoiding basename matches across CDNs when the frame is an absolute URL.
Reviewed by Cursor Bugbot for commit bf3e3a9. Configure here.
| return ( | ||
| frameUrl.pathname === bundleUrlObj.pathname || | ||
| frameUrl.pathname.endsWith(bundleUrlObj.pathname) | ||
| ); |
There was a problem hiding this comment.
Same-origin suffix map mismatch
Low Severity
For two absolute URLs on the same origin, frameMatchesBundle treats frameUrl.pathname.endsWith(bundleUrlObj.pathname) as a match, so a frame under /long/path/app.js can bind to an artifact registered for /app.js and use the wrong map.
Reviewed by Cursor Bugbot for commit bf3e3a9. Configure here.
Parse V8 and Firefox stack frames, resolve positions with uploaded source maps, and expose symbolicated_stack fields on GET /api/errors/:id for display-only de-minification. Co-authored-by: Cursor <[email protected]>
Derive symbolicated_top_stack from the first resolvable frame in occurrence stacks instead of top_stack (error message line), and dedupe concurrent listSourceMapArtifactsForRelease calls per release. Co-authored-by: Cursor <[email protected]>
bf3e3a9 to
b2dd996
Compare


Summary
stack-symbolicate.ts— parse V8/Firefox stack lines, match frames to uploaded maps by(project, app, release, bundle_url), resolve via@jridgewell/trace-mappingGET /api/errors/:idreturns optionalsymbolicated_top_stackand per-occurrencesymbolicated_stackwhen maps exist for the releaseStacked on #122 (phase 3). Merge phase 3 first, then this PR (retarget base to
developafter #122 lands).Part of #98 (v1.3.0). No new migrations.
Test plan
pnpm --filter api exec vitest run src/lib/stack-symbolicate.test.tspnpm run buildsymbolicated_stackon error detailMade with Cursor