Skip to content

fix: transaction processors no longer discard each other's results - #5621

Merged
ric-oliv merged 1 commit into
mainfrom
fix/transaction-processor-chaining
Sep 24, 2026
Merged

ric-oliv merged 1 commit into
mainfrom
fix/transaction-processor-chaining

Conversation

@jamescrosswell

Copy link
Copy Markdown
Collaborator

SentryClient.CaptureTransaction passed the original transaction to every processor in the chain instead of the running result:

foreach (var processor in scope.GetAllTransactionProcessors())
{
    processedTransaction = processor.DoProcessTransaction(transaction, hint);   // <- transaction, not processedTransaction

ISentryTransactionProcessor explicitly allows returning a new instance — "The transaction returned can be the same instance received or a new one." With more than one processor, every intermediate result was therefore discarded and only the last processor's output survived, while each processor saw the unprocessed original. The result is a partially processed transaction, silently.

Anyone whose processors mutate and return the same instance — the common case — is unaffected, which is why this went unnoticed. SentryEventHelper.ProcessEvent already chains correctly, so the two loops had simply diverged.

Spotted by @ric-oliv while reviewing #5607; pulled out into its own PR so it isn't blocked behind that stack and gets its own changelog entry.

The regression test fails without the one-line fix (the second processor receives the original rather than the first's replacement) and passes with it.

🤖 Generated with Claude Code

Each iteration passed the original transaction instead of the running
result, so with more than one processor every intermediate result was
discarded and only the last processor's output survived. Event
processors already chain correctly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.85%. Comparing base (85cc2bf) to head (4c62a25).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5621   +/-   ##
=======================================
  Coverage   74.85%   74.85%           
=======================================
  Files         515      515           
  Lines       18962    18962           
  Branches     3694     3694           
=======================================
  Hits        14194    14194           
  Misses       3891     3891           
  Partials      877      877           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jamescrosswell
jamescrosswell marked this pull request as ready for review September 24, 2026 02:28
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Sep 24, 2026
@ric-oliv
ric-oliv merged commit 5dbddb2 into main Sep 24, 2026
67 of 70 checks passed
@ric-oliv
ric-oliv deleted the fix/transaction-processor-chaining branch September 24, 2026 08:13
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.

2 participants