Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not allow setting measurement if transaction is finished #1026

Merged
merged 10 commits into from
Sep 29, 2022

Conversation

marandaneto
Copy link
Contributor

@marandaneto marandaneto commented Sep 28, 2022

📜 Description

Related to #1011.

💡 Motivation and Context

Does not allow setting measurement if transaction is finished

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

@marandaneto marandaneto marked this pull request as ready for review September 28, 2022 13:30
@marandaneto marandaneto changed the title Does not allow setting measurement if finished Does not allow setting measurement if transaction is finished Sep 28, 2022
@philipphofmann philipphofmann changed the title Does not allow setting measurement if transaction is finished Do not allow setting measurement if transaction is finished Sep 29, 2022
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -284,6 +284,9 @@ class SentryTracer extends ISentrySpan {

@override
void setMeasurement(String name, num value, {SentryMeasurementUnit? unit}) {
if (finished) {
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: Maybe log a debug message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a separate issue to make the tracer loggable because we don't have the instance of the logger, but we'll do it soon.

@codecov-commenter
Copy link

codecov-commenter commented Sep 29, 2022

Codecov Report

Base: 90.12% // Head: 91.37% // Increases project coverage by +1.24% 🎉

Coverage data is based on head (6530b56) compared to base (f92ec54).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1026      +/-   ##
==========================================
+ Coverage   90.12%   91.37%   +1.24%     
==========================================
  Files         114        9     -105     
  Lines        3554      197    -3357     
==========================================
- Hits         3203      180    -3023     
+ Misses        351       17     -334     
Impacted Files Coverage Δ
dart/lib/src/protocol/sentry_span.dart
dart/lib/src/sentry_tracer.dart
dart/lib/src/sentry_tracer_finish_status.dart
dart/lib/src/utils/hash_code.dart
dart/lib/src/protocol/mechanism.dart
dart/lib/src/scope.dart
dart/lib/src/sentry_stack_trace_factory.dart
dart/lib/src/sentry_envelope_item_header.dart
dart/lib/src/sentry_envelope_header.dart
dart/lib/src/sentry_span_context.dart
... and 95 more

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@marandaneto marandaneto enabled auto-merge (squash) September 29, 2022 08:58
@marandaneto marandaneto merged commit 4c2c7c7 into main Sep 29, 2022
@marandaneto marandaneto deleted the fix/measurement-if-finished branch September 29, 2022 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants