File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,11 @@ private void RelayCommandOnPropertyChanged(object? sender, PropertyChangedEventA
147147 // results would be that we would store the transaction on the scope, but it would never be cleared again,
148148 // since the next call to OnPropertyChanged for this RelayCommand will (likely) be from a different thread.
149149 var span = hub . StartSpan ( SpanName , SpanOp ) ;
150+ if ( span is ITransactionTracer transaction )
151+ {
152+ hub . ConfigureScope ( scope => scope . Transaction = transaction ) ;
153+ }
154+
150155 relay . SetFused ( span ) ;
151156 }
152157 else if ( relay . GetFused < ISpan > ( ) is { } span )
Original file line number Diff line number Diff line change @@ -212,7 +212,9 @@ public ITransactionTracer? Transaction
212212 _transactionLock . EnterReadLock ( ) ;
213213 try
214214 {
215- return _transaction . Value ;
215+ // Workaround for https://github.com/getsentry/sentry-dotnet/pull/4125#discussion_r2087994417
216+ // TODO: We should really find the root cause of this issue and address in a seprate PR
217+ return _transaction . Value is { IsFinished : false } transaction ? transaction : null ;
216218 }
217219 finally
218220 {
You can’t perform that action at this time.
0 commit comments