Skip to content

feat(local): Show an error event's attachments in its detail panel - #2106

Merged
BYK merged 3 commits into
mainfrom
byk/local-event-attachments
Nov 9, 2026
Merged

BYK merged 3 commits into
mainfrom
byk/local-event-attachments

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Stacked on #2105.

SDKs send screenshots, view hierarchies and other files along with the error they belong to, but Sentry Local only listed them in the Attachments view. You saw the error in one place and had to go find its screenshot somewhere else. Spotlight shows them under the event (Context → Attachments).

Error event details now have an Attachments section, placed after the event fields and before context and breadcrumbs.

  • eventAttachments in lib/attachments.ts matches every attachment item whose envelope header event_id equals either the event's own envelope header event_id or its payload event_id. That covers attachments in the same envelope as the event and attachments sent later in another envelope. It checks both IDs because they don't always match: in the bundled 08-attachments fixture the header says 8259… and the payload says 9999….
  • Rows use the collapsed, lazily decoded list from fix(local): Decode raw envelope attachments only when previewed #2105. EnvelopeAttachments is now AttachmentList with a label, so the error panel doesn't decode every screenshot just to show a stack trace.
  • Errors with no attachments look the same as before. The Attachments view is unchanged.

Screenshots

Bundled 08-attachments fixture, Events → "Captured attachment examples":

Collapsed order.json and page.html expanded (HTML stays inert source)
collapsed expanded

Testing

  • event-detail.test.tsx: an error lists attachments from its own envelope (header ID different from the payload ID) and from a later envelope that names the payload ID. It skips another event's attachment, keeps them collapsed until you click Show preview, and errors with no attachments render no section.
  • apps/local: pnpm run typecheck, pnpm run lint and pnpm run test (324 tests) pass. oxfmt --check is clean.
  • Manual: replayed the bundled fixtures into a local receiver. The attachment example event shows its four attachments. The TypeError error shows no section.

via @BYK.

--

View Session in Sentry

@sentry-junior
sentry-junior Bot added this pull request to stack #2107 November 9, 2026 14:31
@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-local Ready Ready Preview Nov 9, 2026 2:47pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 9, 2026
Base automatically changed from byk/local-lazy-envelope-attachments to main November 9, 2026 14:33
SDKs send screenshots, view hierarchies and other files in the error's
envelope, but the viewer only listed them in the Attachments view. Error
event details now include an Attachments section with every attachment
whose envelope header names the event, either by the event's own
envelope ID or its payload event_id. Rows reuse the collapsed, lazily
decoded attachment list from raw envelopes.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
Comment thread apps/local/src/lib/attachments.ts Resolved

@BYK BYK 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.

Wait, I didn't realize this was just 2 items 🤦🏻

Revert...

The ID list holds at most two entries, so Array#includes is simpler and
no slower.

This reverts commit 352fe72.
@BYK
BYK enabled stacked auto-merge (squash) November 9, 2026 14:47
@BYK
BYK merged commit 6aa2905 into main Nov 9, 2026
23 checks passed
@BYK
BYK deleted the byk/local-event-attachments branch November 9, 2026 14:48

This branch was successfully deployed

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

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant