Skip to content

Commit 0ac4ade

Browse files
Merge branch 'version6' into dispose-span
2 parents 0adcefc + 7b1b32e commit 0ac4ade

20 files changed

+31
-76
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
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-
- Remove unnecessary files from SentryCocoaFramework before packing ([#4602](https://github.com/getsentry/sentry-dotnet/pull/4602))
8+
- Remove unnecessary files from SentryCocoaFramework before packing ([#4623](https://github.com/getsentry/sentry-dotnet/pull/4623))
9+
10+
### Fixes
11+
12+
- The SDK avoids redundant scope sync after transaction finish ([#4479](https://github.com/getsentry/sentry-dotnet/pull/4479))
913

1014
## 6.0.0-preview.1
1115

src/Sentry/GlobalSessionManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private void DeletePersistedSession()
118118
try
119119
{
120120
var contents = _options.FileSystem.ReadAllTextFromFile(filePath);
121-
_options.LogDebug("Deleting persisted session file with contents: {0}", contents);
121+
_options.LogDebug("Deleting persisted session file with contents: '{0}'", contents);
122122
}
123123
catch (Exception ex)
124124
{

src/Sentry/Internal/BackgroundWorker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ private async Task DoWorkAsync()
177177
}
178178
finally
179179
{
180-
_options.LogDebug("De-queueing event {0}", eventId);
180+
_options.LogDebug("De-queueing event '{0}'", eventId);
181181
_queue.TryDequeue(out _);
182182
Interlocked.Decrement(ref _currentItems);
183183
OnFlushObjectReceived?.Invoke(envelope, EventArgs.Empty);

src/Sentry/Internal/DebugStackTrace.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ internal void MergeDebugImagesInto(SentryEvent @event)
8282
// Frame indexes may be changed as well as _debugImageIndexByModule becoming invalid.
8383
if (_debugImagesMerged)
8484
{
85-
_options.LogWarning("Cannot call MergeDebugImagesInto multiple times. Event: {0}", @event.EventId);
85+
_options.LogWarning("Cannot call MergeDebugImagesInto multiple times. Event: '{0}'", @event.EventId);
8686
return;
8787
}
8888
_debugImagesMerged = true;

src/Sentry/Internal/DuplicateEventDetectionEventProcessor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ internal class DuplicateEventDetectionEventProcessor : ISentryEventProcessor
1515
{
1616
if (_capturedObjects.TryGetValue(@event, out _))
1717
{
18-
_options.LogDebug("Same event instance detected and discarded. EventId: {0}", @event.EventId);
18+
_options.LogDebug("Same event instance detected and discarded. EventId: '{0}'", @event.EventId);
1919
return null;
2020
}
2121
_capturedObjects.Add(@event, null);
@@ -38,7 +38,7 @@ private bool IsDuplicate(Exception ex, SentryId eventId, bool debugLog)
3838
{
3939
if (debugLog)
4040
{
41-
_options.LogDebug("Duplicate Exception: 'SameExceptionInstance'. Event {0} will be discarded.", eventId);
41+
_options.LogDebug("Duplicate Exception: 'SameExceptionInstance'. Event '{0}' will be discarded.", eventId);
4242
}
4343
return true;
4444
}
@@ -52,7 +52,7 @@ private bool IsDuplicate(Exception ex, SentryId eventId, bool debugLog)
5252
var result = aex.InnerExceptions.Any(e => IsDuplicate(e, eventId, false));
5353
if (result)
5454
{
55-
_options.LogDebug("Duplicate Exception: 'AggregateException'. Event {0} will be discarded.", eventId);
55+
_options.LogDebug("Duplicate Exception: 'AggregateException'. Event '{0}' will be discarded.", eventId);
5656
}
5757

5858
return result;
@@ -63,7 +63,7 @@ private bool IsDuplicate(Exception ex, SentryId eventId, bool debugLog)
6363
{
6464
if (IsDuplicate(ex.InnerException, eventId, false))
6565
{
66-
_options.LogDebug("Duplicate Exception: 'SameExceptionInstance'. Event {0} will be discarded.", eventId);
66+
_options.LogDebug("Duplicate Exception: 'SameExceptionInstance'. Event '{0}' will be discarded.", eventId);
6767
return true;
6868
}
6969
}

src/Sentry/Internal/Http/CachingTransport.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,15 +343,15 @@ private async Task InnerProcessCacheAsync(string file, CancellationToken cancell
343343

344344
try
345345
{
346-
_options.LogDebug("Sending cached envelope: {0}",
346+
_options.LogDebug("Sending cached envelope: '{0}'",
347347
envelope.TryGetEventId(_options.DiagnosticLogger));
348348

349349
await _innerTransport.SendEnvelopeAsync(envelope, cancellation).ConfigureAwait(false);
350350
}
351351
// OperationCancel should not log an error
352352
catch (OperationCanceledException ex)
353353
{
354-
_options.LogDebug("Canceled sending cached envelope: {0}, retrying after a delay.", ex, file);
354+
_options.LogDebug("Canceled sending cached envelope: '{0}', retrying after a delay.", ex, file);
355355
// Let the worker catch, log, wait a bit and retry.
356356
throw;
357357
}

src/Sentry/Internal/Hub.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ private void AddBreadcrumbForException(SentryEvent evt, Scope scope)
505505
}
506506
catch (Exception e)
507507
{
508-
_options.LogError(e, "Failure to store breadcrumb for exception event: {0}", evt.EventId);
508+
_options.LogError(e, "Failure to store breadcrumb for exception event: '{0}'", evt.EventId);
509509
}
510510
}
511511

src/Sentry/Internal/MainSentryEventProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public MainSentryEventProcessor(
3434

3535
public SentryEvent Process(SentryEvent @event)
3636
{
37-
_options.LogDebug("Running main event processor on: Event {0}", @event.EventId);
37+
_options.LogDebug("Running main event processor on: Event '{0}'", @event.EventId);
3838

3939
if (TimeZoneInfo.Local is { } timeZoneInfo)
4040
{

src/Sentry/Internal/SentryEventHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ internal static class SentryEventHelper
3737
return @event;
3838
}
3939

40-
options.LogDebug("Calling the BeforeSend callback");
40+
options.LogDebug("Calling the BeforeSend callback.");
4141
try
4242
{
4343
@event = options.BeforeSendInternal?.Invoke(@event, hint);

src/Sentry/Scope.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -818,11 +818,7 @@ internal void ResetTransaction(ITransactionTracer? expectedCurrentTransaction)
818818
if (ReferenceEquals(_transaction.Value, expectedCurrentTransaction))
819819
{
820820
_transaction.Value = null;
821-
if (Options.EnableScopeSync)
822-
{
823-
// We have to restore the trace on the native layers to be in sync with the current scope
824-
Options.ScopeObserver?.SetTrace(PropagationContext.TraceId, PropagationContext.SpanId);
825-
}
821+
SetPropagationContext(new SentryPropagationContext());
826822
}
827823
}
828824
finally

0 commit comments

Comments
 (0)