Repository navigation
fix(core): Record client outcomes when beforeSend callbacks return invalid values - #25049
Merged
Lms24 merged 2 commits intoOct 12, 2026
Merged
Conversation
Lms24
added this pull request to stack #25050
October 5, 2026 11:40
Contributor
size-limit report 📦
|
Lms24
commented
Oct 5, 2026
| /** | ||
| * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so. | ||
| */ | ||
| function _validateBeforeSendResult( |
Member
Author
There was a problem hiding this comment.
this function can conveniently be removed because the invalidValueError is now directly thrown in line 1569 and the ${beforeSendLabel} rejected with ${e} wasn't reached already because of safeCallback handling throws now. So this was mostly just dead code that could be simplified.
Lms24
force-pushed
the
lms/fix-core-before-send-reject-outcomes
branch
from
October 5, 2026 17:51
535f0b3 to
8064da8
Compare
Lms24
force-pushed
the
lms/fix-core-before-send-reject-outcomes
branch
from
October 8, 2026 13:06
8064da8 to
ef30978
Compare
Lms24
force-pushed
the
lms/fix-core-before-send-reject-outcomes
branch
from
October 9, 2026 07:24
ef30978 to
886772e
Compare
Lms24
marked this pull request as ready for review
October 9, 2026 10:46
msonnb
approved these changes
Oct 9, 2026
Lms24
force-pushed
the
lms/fix-core-before-send-reject-outcomes
branch
from
October 9, 2026 12:23
886772e to
1885f0b
Compare
chargome
approved these changes
Oct 9, 2026
Lms24
force-pushed
the
lms/fix-core-before-send-reject-outcomes
branch
3 times, most recently
from
October 9, 2026 15:50
3e615ef to
1eb7252
Compare
…valid values When `beforeSend` or `beforeSendTransaction` returned something other than an event or `null` (e.g. `undefined` from a forgotten `return`), the event was dropped without recording any outcome. It now records `before_send` outcomes for the event category and, for transactions, the root span plus all child spans that were not already recorded as `ignored`. Validation moves into the existing drop branch, which removes `_validateBeforeSendResult`. Its rejection branch was dead code because `safeCallback` already turns a rejected callback into a `callback_error` drop; a test now covers that for `beforeSendTransaction` as well. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Lms24
force-pushed
the
lms/fix-core-before-send-reject-outcomes
branch
from
October 12, 2026 08:04
1eb7252 to
46d75b6
Compare
47 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
beforeSendorbeforeSendTransactionreturns something other than an event ornull(oftenundefinedfrom a forgottenreturn), the event is dropped but no client outcome is recorded. It now records abefore_sendoutcome for the event's category and, for transactions, the rootspanplus all child spans that weren't already recorded asignored.