fix: abortTransaction does not call provided execute function when parent span is null#3062
Merged
buenaflor merged 8 commits intoJul 14, 2025
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3062 +/- ##
============================================
+ Coverage 78.66% 100.00% +21.33%
============================================
Files 34 1 -33
Lines 1364 51 -1313
============================================
- Hits 1073 51 -1022
+ Misses 291 0 -291 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
Thank you for the investigation and bug fix! I'll have a look later today (sry, accidentally clicked the close button) |
buenaflor
reviewed
Jul 10, 2025
buenaflor
left a comment
Contributor
There was a problem hiding this comment.
Looks good, I would only change one test case
Contributor
|
@ichiko last task is to update the changelog: ### Fixes
- Drift transaction rollback not executed when parent span is null ([#3062](https://github.com/getsentry/sentry-dart/pull/3062)) |
buenaflor
approved these changes
Jul 14, 2025
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.
📜 Description
This PR fixes a bug in the abortTransaction method where database operations were blocked when no parent span exists. The issue was reported in #3058.
💡 Motivation and Context
When parentSpan is null in the abortTransaction method (lines 147-153), the method was logging a warning and returning
Future<T>.value()without executing the provided execute function. This meant the actual database transaction abort operation was never performed, leaving the database in an inconsistent state where:💚 How did you test it?
Added comprehensive tests to verify the fix.
📝 Checklist
sendDefaultPiiis enabled🔮 Next steps