fix: Reset transaction in scope if span is reset#1125
Conversation
|
@lColinDl I don't really follow the issue, the transaction name is bound to the span object, so it is doing what it should do. |
That's exactly what this PR does, because that's currently not the case. When a transaction finishes, the transaction name is still added to events from after the transaction. |
That's right, but then this code is breaking the sentry-dart/dart/lib/src/sentry_tracer.dart Lines 113 to 118 in 25e9b59
|
I don't see how this PR is breaking existing desired behavior. I intentionally tried to stay as close to the original behavior as possible. Setting the Unfortunately I can't quite follow the rest of your argument. If you have a better solution to fixing the problem, I obviously don't mind it. |
You're right, sorry for the confusion, I was misreading the spec. |
Done: 8e21c1c |
Codecov ReportBase: 90.09% // Head: 90.08% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1125 +/- ##
==========================================
- Coverage 90.09% 90.08% -0.01%
==========================================
Files 117 117
Lines 3605 3602 -3
==========================================
- Hits 3248 3245 -3
Misses 357 357
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Base branch was modified
📜 Description
The private
_transactionis not set anymore when setting aspanonScope. Instead the code relies on the public getter fortransactionthat already had logic in using the span name as thetransactionif available. By doing so thetransactionname is set back to null after a transaction finishes.💡 Motivation and Context
Previously events had a transaction string set of transactions that already finished earlier. Because after a transaction finished, the
_transactionfield inScopewas never reset.💚 How did you test it?
Added new new tests. Existing tests still work.
📝 Checklist
🔮 Next steps