Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/ByteSync.Client/Services/Communications/ConnectionService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Net.Http;
using System.Net.Http;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Threading;
Expand Down Expand Up @@ -65,13 +65,17 @@
public ByteSyncEndpoint? CurrentEndPoint { get; set; }

public string? ClientInstanceId => CurrentEndPoint?.ClientInstanceId;

public Func<int, TimeSpan>? RetryDelaySleepDurationProvider { get; set; }

public async Task StartConnectionAsync()
{
var retryDelaySleepDurationProvider = RetryDelaySleepDurationProvider;

var retryPolicy = Policy
.Handle<Exception>(ex => !(ex is BuildConnectionException bce && bce.InitialConnectionStatus == InitialConnectionStatus.VersionNotAllowed))
.WaitAndRetryForeverAsync(
retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)),
retryAttempt => retryDelaySleepDurationProvider?.Invoke(retryAttempt) ?? TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)),
(exception, _, _) =>
Comment on lines +69 to 79
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

RetryDelaySleepDurationProvider is a mutable public delegate that is read inside the Polly retry delay lambda. If the property is changed from another thread while StartConnectionAsync() is running, retry delays can change mid-loop, making behavior nondeterministic. Capture the provider in a local variable before building the policy (or make it immutable via constructor injection) so the retry policy uses a consistent delay function for the entire connection attempt.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. I fixed this by snapshotting RetryDelaySleepDurationProvider before creating the Polly retry policy, so retry delays stay consistent for the whole StartConnectionAsync() attempt.

{
ConnectionStatusSubject.OnNext(ConnectionStatuses.NotConnected);
Expand Down Expand Up @@ -204,7 +208,7 @@
ConnectionStatusSubject.OnNext(ConnectionStatuses.NotConnected);
}

public void Dispose()

Check warning on line 211 in src/ByteSync.Client/Services/Communications/ConnectionService.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Change ConnectionService.Dispose() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it.

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yz6H6mKswA82EyJU0&open=AZ1yz6H6mKswA82EyJU0&pullRequest=287
{
_connectionSubscription?.Dispose();
_refreshCancellationTokenSource?.Dispose();
Expand All @@ -226,4 +230,4 @@

return Task.CompletedTask;
}
}
}
15 changes: 11 additions & 4 deletions src/ByteSync.Client/Services/Misc/Factories/PolicyFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,22 @@ namespace ByteSync.Services.Misc.Factories;
public class PolicyFactory : IPolicyFactory
{
private readonly ILogger<PolicyFactory> _logger;
private readonly Func<int, TimeSpan> _sleepDurationProvider;

public PolicyFactory(ILogger<PolicyFactory> logger)
: this(logger, DefaultSleepDurationProvider)
{
}

public PolicyFactory(ILogger<PolicyFactory> logger, Func<int, TimeSpan> sleepDurationProvider)
{
_logger = logger;
_sleepDurationProvider = sleepDurationProvider;
}

private const int MAX_RETRIES = 5;

private TimeSpan SleepDurationProvider(int retryAttempt)
private static TimeSpan DefaultSleepDurationProvider(int retryAttempt)
{
// Exponential backoff with jitter: 2^({attempt}-1) seconds + 0-500ms
var baseSeconds = Math.Pow(2, Math.Max(0, retryAttempt - 1));
Expand All @@ -39,7 +46,7 @@ public AsyncRetryPolicy<DownloadFileResponse> BuildFileDownloadPolicy()
var policy = Policy
.HandleResult<DownloadFileResponse>(x => !x.IsSuccess)
.Or<HttpRequestException>(e => e.StatusCode == HttpStatusCode.Forbidden)
.WaitAndRetryAsync(MAX_RETRIES, SleepDurationProvider, onRetryAsync: async (response, timeSpan, retryCount, _) =>
.WaitAndRetryAsync(MAX_RETRIES, _sleepDurationProvider, onRetryAsync: async (response, timeSpan, retryCount, _) =>
{
_logger.LogError(response.Exception,
"FileTransferOperation failed (Attempt number {AttemptNumber}). ResponseCode:{ResponseCode} ExceptionType:{ExceptionType}, ExceptionMessage:{ExceptionMessage}. Waiting {WaitingTime} seconds before retry",
Expand Down Expand Up @@ -68,7 +75,7 @@ public AsyncRetryPolicy<UploadFileResponse> BuildFileUploadPolicy()
|| ex.HttpStatusCode == HttpStatusCode.InternalServerError)
.Or<TaskCanceledException>()
.Or<TimeoutException>()
.WaitAndRetryAsync(MAX_RETRIES, SleepDurationProvider, onRetryAsync: async (response, timeSpan, retryCount, _) =>
.WaitAndRetryAsync(MAX_RETRIES, _sleepDurationProvider, onRetryAsync: async (response, timeSpan, retryCount, _) =>
{
_logger.LogError(response.Exception,
"FileTransferOperation failed (Attempt number {AttemptNumber}). ResponseCode:{ResponseCode} ExceptionType:{ExceptionType}, ExceptionMessage:{ExceptionMessage}. Waiting {WaitingTime} seconds before retry",
Expand All @@ -78,4 +85,4 @@ public AsyncRetryPolicy<UploadFileResponse> BuildFileUploadPolicy()

return policy;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Reactive.Linq;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using ByteSync.Business.Misc;
using ByteSync.Interfaces.Controls.TimeTracking;
Expand All @@ -11,10 +12,12 @@ public class TimeTrackingComputer : ITimeTrackingComputer
private readonly BehaviorSubject<bool> _isStarted;

private readonly IDataTrackingStrategy _dataTrackingStrategy;
private readonly IScheduler _scheduler;

public TimeTrackingComputer(IDataTrackingStrategy dataTrackingStrategy)
public TimeTrackingComputer(IDataTrackingStrategy dataTrackingStrategy, IScheduler? scheduler = null)
{
_dataTrackingStrategy = dataTrackingStrategy;
_scheduler = scheduler ?? Scheduler.Default;

_timeTrack = new BehaviorSubject<TimeTrack>(new TimeTrack());
_isStarted = new BehaviorSubject<bool>(false);
Expand Down Expand Up @@ -49,7 +52,7 @@ public IObservable<TimeTrack> RemainingTime
{
if (isStarted)
{
return Observable.Interval(TimeSpan.FromSeconds(1));
return Observable.Interval(TimeSpan.FromSeconds(1), _scheduler);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.CodeAnalysis;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
Expand Down Expand Up @@ -27,7 +27,7 @@
private readonly MainWindow _mainWindow;

[ExcludeFromCodeCoverage]
public AddTrustedClientViewModel()

Check warning on line 30 in src/ByteSync.Client/ViewModels/TrustedNetworks/AddTrustedClientViewModel.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Non-nullable field '_publicKeysManager' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1y0sH2mIhOY1u5Z9uy&open=AZ1y0sH2mIhOY1u5Z9uy&pullRequest=287
{
#if DEBUG
if (Design.IsDesignMode)
Expand All @@ -39,7 +39,7 @@
var safetyKey = "";
for (var i = 0; i < 16; i++)
{
safetyKey += "string_" + i + " ";

Check warning on line 42 in src/ByteSync.Client/ViewModels/TrustedNetworks/AddTrustedClientViewModel.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a StringBuilder instead.

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1y0sH2mIhOY1u5Z9ux&open=AZ1y0sH2mIhOY1u5Z9ux&pullRequest=287
}

SafetyKeyParts = safetyKey.Split(" ", StringSplitOptions.RemoveEmptyEntries);
Expand All @@ -49,7 +49,7 @@
#endif
}

public AddTrustedClientViewModel(PublicKeyCheckData? publicKeyCheckData, TrustDataParameters trustDataParameters,

Check warning on line 52 in src/ByteSync.Client/ViewModels/TrustedNetworks/AddTrustedClientViewModel.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Non-nullable field '_publicKeysManager' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1y0sH2mIhOY1u5Z9uz&open=AZ1y0sH2mIhOY1u5Z9uz&pullRequest=287
IPublicKeysManager publicKeysManager, IApplicationSettingsRepository applicationSettingsManager,
IPublicKeysTruster publicKeysTruster, ILogger<AddTrustedClientViewModel> logger, MainWindow mainWindow)
{
Expand All @@ -66,10 +66,10 @@
_logger = logger;
_mainWindow = mainWindow;

if (publicKeyCheckData == null)
{
throw new ArgumentNullException(nameof(publicKeyCheckData));
}

Check warning on line 72 in src/ByteSync.Client/ViewModels/TrustedNetworks/AddTrustedClientViewModel.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1y0sH2mIhOY1u5Z9u1&open=AZ1y0sH2mIhOY1u5Z9u1&pullRequest=287

MyClientId = _applicationSettingsRepository.GetCurrentApplicationSettings().ClientId;
OtherClientId = publicKeyCheckData.IssuerPublicKeyInfo.ClientId;
Expand Down Expand Up @@ -224,7 +224,7 @@

if (clipboard != null)
{
var clipBoardValue = await clipboard.GetTextAsync();

Check warning on line 227 in src/ByteSync.Client/ViewModels/TrustedNetworks/AddTrustedClientViewModel.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

'IClipboard.GetTextAsync()' is obsolete: 'Use ClipboardExtensions.TryGetTextAsync instead'

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1y0sH2mIhOY1u5Z9u0&open=AZ1y0sH2mIhOY1u5Z9u0&pullRequest=287

var isSuccess = SafetyKeyParts.Length > 1 && SafetyKeyParts.JoinToString(" ").Equals(clipBoardValue);

Expand Down Expand Up @@ -279,13 +279,13 @@
_publicKeysManager.Trust(TrustedPublicKey);

ShowSuccess = true;
await Task.Delay(TimeSpan.FromSeconds(3));
await DelayAsync(TimeSpan.FromSeconds(3));
ShowSuccess = false;
}
else
{
ShowError = true;
await Task.Delay(TimeSpan.FromSeconds(3));
await DelayAsync(TimeSpan.FromSeconds(3));
ShowError = false;
}

Expand All @@ -309,7 +309,7 @@
var task2 = _publicKeysTruster.OnPublicKeyValidationCanceled(PublicKeyCheckData!, TrustDataParameters);

ShowError = true;
await Task.Delay(TimeSpan.FromSeconds(3));
await DelayAsync(TimeSpan.FromSeconds(3));
ShowError = false;

await Task.WhenAll(task, task2);
Expand All @@ -330,6 +330,8 @@
await _publicKeysTruster.OnPublicKeyValidationCanceled(PublicKeyCheckData!, TrustDataParameters);
}

protected virtual Task DelayAsync(TimeSpan delay) => Task.Delay(delay);

private string[] BuildSafetyWords()
{
var safetyWordsComputer = new SafetyWordsComputer(SafetyWordsValues.AVAILABLE_WORDS);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ByteSync.Business.Communications;
using ByteSync.Business.Communications;
using ByteSync.Common.Business.Auth;
using ByteSync.Common.Business.EndPoints;
using ByteSync.Exceptions;
Expand All @@ -15,11 +15,11 @@

public class ConnectionServiceTests
{
private Mock<IConnectionFactory> _mockConnectionFactory;

Check warning on line 18 in tests/ByteSync.Client.UnitTests/Services/Communications/ConnectionServiceTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Non-nullable field '_mockConnectionFactory' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yz6LmmKswA82EyJU1&open=AZ1yz6LmmKswA82EyJU1&pullRequest=287
private Mock<IAuthenticationTokensRepository> _mockAuthenticationTokensRepository;

Check warning on line 19 in tests/ByteSync.Client.UnitTests/Services/Communications/ConnectionServiceTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Non-nullable field '_mockAuthenticationTokensRepository' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yz6LmmKswA82EyJU2&open=AZ1yz6LmmKswA82EyJU2&pullRequest=287
private Mock<ILogger<ConnectionService>> _mockLogger;

Check warning on line 20 in tests/ByteSync.Client.UnitTests/Services/Communications/ConnectionServiceTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Non-nullable field '_mockLogger' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yz6LmmKswA82EyJU3&open=AZ1yz6LmmKswA82EyJU3&pullRequest=287

private ConnectionService _connectionService;

Check warning on line 22 in tests/ByteSync.Client.UnitTests/Services/Communications/ConnectionServiceTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Non-nullable field '_connectionService' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yz6LmmKswA82EyJU4&open=AZ1yz6LmmKswA82EyJU4&pullRequest=287

[SetUp]
public void SetUp()
Expand All @@ -33,6 +33,8 @@
_mockAuthenticationTokensRepository.Object,
_mockLogger.Object
);

_connectionService.RetryDelaySleepDurationProvider = _ => TimeSpan.Zero;
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
public void SetUp()
{
_mockLogger = new Mock<ILogger<PolicyFactory>>();
_factory = new PolicyFactory(_mockLogger.Object);
_factory = new PolicyFactory(_mockLogger.Object, _ => TimeSpan.Zero);
}

[TestCase(HttpStatusCode.Forbidden)]
Expand All @@ -31,24 +31,21 @@
public async Task BuildFileUploadPolicy_ShouldRetry_On_HttpRequestException_StatusCodes(HttpStatusCode status)
{
var policy = _factory.BuildFileUploadPolicy();

using var cts = new CancellationTokenSource();
cts.CancelAfter(1000);


Func<Task> act = async () =>
{
await policy.ExecuteAsync(async _ => { throw new HttpRequestException("test", inner: null, statusCode: status); },
cts.Token);
CancellationToken.None);
};
await act.Should().ThrowAsync<OperationCanceledException>();

await act.Should().ThrowAsync<HttpRequestException>();

_mockLogger.Verify(x => x.Log(
It.Is<LogLevel>(l => l == LogLevel.Error),

Check warning on line 44 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMj&open=AZ1yb41ibfjn6n6iAdMj&pullRequest=287
It.IsAny<EventId>(),

Check warning on line 45 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMk&open=AZ1yb41ibfjn6n6iAdMk&pullRequest=287
It.Is<It.IsAnyType>((v, t) => v.ToString()!.Contains("FileTransferOperation failed")),

Check warning on line 46 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMl&open=AZ1yb41ibfjn6n6iAdMl&pullRequest=287
It.IsAny<Exception>(),

Check warning on line 47 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMm&open=AZ1yb41ibfjn6n6iAdMm&pullRequest=287
It.IsAny<Func<It.IsAnyType, Exception?, string>>()), Times.AtLeastOnce);

Check warning on line 48 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMn&open=AZ1yb41ibfjn6n6iAdMn&pullRequest=287
}

[TestCase(HttpStatusCode.Unauthorized)]
Expand All @@ -60,20 +57,17 @@
public async Task BuildFileUploadPolicy_ShouldRetry_On_ApiException_StatusCodes(HttpStatusCode status)
{
var policy = _factory.BuildFileUploadPolicy();

using var cts = new CancellationTokenSource();
cts.CancelAfter(1000);

Func<Task> act = async () => { await policy.ExecuteAsync(async _ => { throw new ApiException("api error", status); }, cts.Token); };

await act.Should().ThrowAsync<OperationCanceledException>();

Func<Task> act = async () => { await policy.ExecuteAsync(async _ => { throw new ApiException("api error", status); }, CancellationToken.None); };

await act.Should().ThrowAsync<ApiException>();

_mockLogger.Verify(x => x.Log(
It.Is<LogLevel>(l => l == LogLevel.Error),

Check warning on line 66 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMo&open=AZ1yb41ibfjn6n6iAdMo&pullRequest=287
It.IsAny<EventId>(),

Check warning on line 67 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMp&open=AZ1yb41ibfjn6n6iAdMp&pullRequest=287
It.Is<It.IsAnyType>((v, t) => v.ToString()!.Contains("FileTransferOperation failed")),

Check warning on line 68 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMq&open=AZ1yb41ibfjn6n6iAdMq&pullRequest=287
It.IsAny<Exception>(),

Check warning on line 69 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMr&open=AZ1yb41ibfjn6n6iAdMr&pullRequest=287
It.IsAny<Func<It.IsAnyType, Exception?, string>>()), Times.AtLeastOnce);

Check warning on line 70 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMs&open=AZ1yb41ibfjn6n6iAdMs&pullRequest=287
}

[Test]
Expand All @@ -95,10 +89,10 @@
await act.Should().ThrowAsync<HttpRequestException>();

_mockLogger.Verify(x => x.Log(
It.IsAny<LogLevel>(),

Check warning on line 92 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMt&open=AZ1yb41ibfjn6n6iAdMt&pullRequest=287
It.IsAny<EventId>(),

Check warning on line 93 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMu&open=AZ1yb41ibfjn6n6iAdMu&pullRequest=287
It.IsAny<It.IsAnyType>(),

Check warning on line 94 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMv&open=AZ1yb41ibfjn6n6iAdMv&pullRequest=287
It.IsAny<Exception>(),

Check warning on line 95 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMw&open=AZ1yb41ibfjn6n6iAdMw&pullRequest=287
It.IsAny<Func<It.IsAnyType, Exception?, string>>()), Times.Never);

Check warning on line 96 in tests/ByteSync.Client.UnitTests/Services/Misc/Factories/PolicyFactoryTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Evaluation of this argument may be expensive and unnecessary if logging is disabled

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb41ibfjn6n6iAdMx&open=AZ1yb41ibfjn6n6iAdMx&pullRequest=287
}
}
}
Loading
Loading