Skip to content

fix(cli): Keep one copy of a resent event in sentry local - #2480

Merged
MathurAditya724 merged 2 commits into
mainfrom
fix/local-dedupe-event-id
Nov 24, 2026
Merged

MathurAditya724 merged 2 commits into
mainfrom
fix/local-dedupe-event-id

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

When a JS SDK has both Spotlight and a DSN pointing at the same Local receiver, it sends every error and transaction twice with the same event_id. The tail and local event list showed both copies. Posting the same envelope twice did the same.

Now a receiver or session keeps the first copy of an event, transaction or feedback envelope per event ID, as long as that copy is still retained. The resend still gets a 200. The event ID is the same one local event list shows: the header event_id, or the event or transaction item's when the header has none. The receiver works it out from the item headers while it accepts the envelope, so the plain receiver, sessions and local run all get it.

Some things share an ID on purpose, so they're left alone:

  • check-ins (sentry-java and sentry-elixir use the check-in ID as the event ID for every status)
  • replay segments (they all carry the replay ID)
  • envelopes with no event ID at all, such as logs and spans. These still show twice in the Spotlight + DSN setup.
before (same error sent to Spotlight and the DSN):
07:10:22 [ERROR]   [SERVER]  Error: app-b boom
07:10:22 [ERROR]   [SERVER]  Error: app-b boom

after:
07:27:29 [ERROR]   [SERVER]  Error: app-b boom

via @MathurAditya724.

--

View Session [Sentry]

An SDK with both Spotlight and a DSN on the same Local receiver sends every
error and transaction twice with the same event_id, and the tail and
`local event list` showed both. Receivers and sessions now keep the first
copy of an event, transaction, or feedback envelope per event ID while it
is retained. Replay segments, check-ins, and envelopes without an event ID
are kept as before.

Co-Authored-By: Aditya Mathur <57684218+MathurAditya724@users.noreply.github.com>
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
cli Ready Ready Preview Nov 24, 2026 8:18am UTC
sentry-local Ready Ready Preview Nov 24, 2026 8:18am UTC

Request Review

The dedupe key read only the envelope header's event_id, while event list
falls back to the event or transaction item's. An envelope with its ID only
in the item still showed twice under that ID. Both now use one lookup.

The receiver computes the key from the header it already parsed and the
item header lines, and reads an item payload only when the header has no
event ID, so retention no longer decodes the envelope to check it.

Co-Authored-By: Aditya Mathur <57684218+MathurAditya724@users.noreply.github.com>

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

Reviewed exact head 664b672 against current main. No actionable findings. Typecheck and lint passed; the full workspace test suite passed on rerun. One viewer history-navigation test failed on the initial run and passed both in isolation and on the full rerun. Reviewed dedup identity/eviction/clear behavior and exclusions for replay segments, check-in updates, logs and spans. Independent verify-toolkit CLI QA used a real Node SDK with both DSN and Spotlight pointing at the isolated receiver: the same captured error was retained exactly once. Session retention, summary and capability-redaction checks passed (sentry-local#session-retained, sentry-local#event-list-summary, sentry-local#capability-redacted).

@MathurAditya724
MathurAditya724 merged commit 7c26751 into main Nov 24, 2026
44 checks passed
@MathurAditya724
MathurAditya724 deleted the fix/local-dedupe-event-id branch November 24, 2026 10:58

This branch was successfully deployed

2 active deployments
Preview – sentry-local — 664b6727 Deployed Nov 24, 2026 by vercel[bot]
Preview – cli — 664b6727 Deployed Nov 24, 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