Improve before_send and before_send_transaction's return value handling#2504
Merged
Improve before_send and before_send_transaction's return value handling#2504
before_send and before_send_transaction's return value handling#2504Conversation
- It's usually better to require files explicitly when the number of files is manageable. Given that we only need 2 at the moment, I don't think it's worth using Dir.glob. - Also, using Dir.glob causes it to load the Rakefile, which is for isolated testing and it actually initializes the SDK with the wrong configuration in other tests.
…n-events Currently, if the callbacks return non-event and non-nil values, they'd cause exceptions during serialization, which are rescued and ignored, without explicit logging. This commit adds additional checks to the return values so the users get warnings and also avoids the unnecessary exceptions.
56fbe47 to
bf68695
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2504 +/- ##
==========================================
- Coverage 98.20% 98.18% -0.02%
==========================================
Files 128 128
Lines 4837 4847 +10
==========================================
+ Hits 4750 4759 +9
- Misses 87 88 +1
|
solnic
approved these changes
Jan 2, 2025
Collaborator
solnic
left a comment
There was a problem hiding this comment.
LGTM (except that one typo in a comment)
Co-authored-by: Peter Solnica <peter@solnica.online>
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.
The 1st commit fixes a testing setup issue and the 2nd commit adds additional checks to the
before_sendandbefore_send_transaction's callback values. I explained the changes with more details in the commit messages.