Skip to content

Commit 349bfa5

Browse files
Review feedback
1 parent 5260090 commit 349bfa5

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
### BREAKING CHANGES
66

77
- SentryOptions.IsEnvironmentUser now defaults to false on MAUI. The means the User.Name will no longer be set, by default, to the name of the device ([#4606](https://github.com/getsentry/sentry-dotnet/pull/4606))
8-
- Spans and Transactions now implement `IDispose` so that they can be used with `using` statements that will automatically finish the span when it passes out of scope, to be consistent with `Activity` classes when using OpenTelemetry ([#4627](https://github.com/getsentry/sentry-dotnet/pull/4627))
8+
- Spans and Transactions now implement `IDispose` so that they can be used with `using` statements/declarations that will automatically finish the span with a status of OK when it passes out of scope, if it has not already been finished, to be consistent with `Activity` classes when using OpenTelemetry ([#4627](https://github.com/getsentry/sentry-dotnet/pull/4627))
9+
- SpanTracer and TransactionTracer are still public but these are now `sealed` (see also [#4627](https://github.com/getsentry/sentry-dotnet/pull/4627))
910
- Remove unnecessary files from SentryCocoaFramework before packing ([#4602](https://github.com/getsentry/sentry-dotnet/pull/4602))
1011

1112
### Fixes

src/Sentry/TransactionTracer.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,15 @@ private void ReleaseSpans()
440440
}
441441

442442
/// <summary>
443-
/// Automatically finishes the span at the end of a <c>using</c> block. This is a convenience method only. Disposing
444-
/// is not required (and analyser warnings are suppressed).
443+
/// <para>
444+
/// Automatically finishes the transaction with a status of <see cref="SpanStatus.Ok" /> at the end of a
445+
/// <c>using</c> block, if it has not already been finished.
446+
/// </para>
447+
/// <para>
448+
/// This is the equivalent of calling <see cref="Finish()" /> when the transaction passes out of scope.
449+
/// </para>
445450
/// </summary>
451+
/// <remarks>This is a convenience method only. Disposing is not required.</remarks>
446452
public void Dispose()
447453
{
448454
Finish();

test/Sentry.Tests/SpanTracerTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public async Task SetExtra_DataInserted_NoDataLoss()
4141
}
4242

4343
[Fact]
44-
public void Dispose_Finished_Finishes()
44+
public void Dispose_TransactionIsUnfinished_FinishesTransaction()
4545
{
4646
// Arrange
4747
var hub = Substitute.For<IHub>();
@@ -55,7 +55,7 @@ public void Dispose_Finished_Finishes()
5555
}
5656

5757
[Fact]
58-
public void Dispose_Unfinished_DoesNothing()
58+
public void Dispose_TransactionIsFinsished_DoesNothing()
5959
{
6060
// Arrange
6161
var hub = Substitute.For<IHub>();

0 commit comments

Comments
 (0)