Repository navigation
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.
…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 5, 2026 17:51
535f0b3 to
8064da8
Compare
This branch has not been deployed
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 recordsbefore_sendoutcomes for the event's category and, for transactions, the root span plus all child spans that weren't already recorded asignored. I pickedbefore_sendoverinvalidbecause the event itself is valid and the user's callback is what dropped it. In the spec,invalidis for telemetry items that fail validation themselves.The validation now lives in the existing drop branch, so
_validateBeforeSendResultgoes away. Its rejection branch was dead code becausesafeCallback(from #25006) already turns a rejected callback into acallback_errordrop. New tests cover that forbeforeSendTransactionwith ignored child spans.🤖 Generated with Claude Code