Skip to content
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,15 @@
public ByteSyncEndpoint? CurrentEndPoint { get; set; }

public string? ClientInstanceId => CurrentEndPoint?.ClientInstanceId;

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

public async Task StartConnectionAsync()
{
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 77
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.
{
ConnectionStatusSubject.OnNext(ConnectionStatuses.NotConnected);
Expand Down Expand Up @@ -204,7 +206,7 @@
ConnectionStatusSubject.OnNext(ConnectionStatuses.NotConnected);
}

public void Dispose()

Check warning on line 209 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 Down
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
Expand Up @@ -6,6 +6,7 @@
using ByteSync.Common.Business.Actions;
using ByteSync.Common.Business.Inventories;
using ByteSync.Common.Business.SharedFiles;
using ByteSync.TestsCommon;
using ByteSync.DependencyInjection;
using ByteSync.Interfaces.Controls.Communications.Http;
using ByteSync.Interfaces.Factories;
Expand All @@ -22,13 +23,14 @@

namespace ByteSync.Client.IntegrationTests.Services.Communications.Transfers;

public class R2DownloadResume_Tests
public class R2DownloadResume_Tests : AbstractTester
{
private ILifetimeScope _clientScope = null!;

[SetUp]
public void SetUp()
{
CreateTestDirectory();
// ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
if (ByteSync.Services.ContainerProvider.Container == null)
{
Expand Down Expand Up @@ -58,6 +60,11 @@ public void SetUp()
public void TearDown()
{
_clientScope.Dispose();

if (TestDirectory?.Exists == true)
{
TestDirectory.Delete(true);
}
}

[Test]
Expand Down Expand Up @@ -99,7 +106,7 @@ public async Task Download_WithTransientFailure_Should_Retry_And_Succeed()
Source = new SharedDataPart
{
ClientInstanceId = shared.ClientInstanceId,
RootPath = Path.GetTempPath(),
RootPath = TestDirectory.FullName,
InventoryPartType = FileSystemTypes.File,
Name = "itests",
InventoryCodeAndId = "itests"
Expand All @@ -113,7 +120,7 @@ public async Task Download_WithTransientFailure_Should_Retry_And_Succeed()
sag.Targets.Add(new SharedDataPart
{
ClientInstanceId = shared.ClientInstanceId,
RootPath = Path.GetTempFileName(),
RootPath = Path.Combine(TestDirectory.FullName, Guid.NewGuid().ToString("N") + ".tmp"),
InventoryPartType = FileSystemTypes.File,
Name = "itests",
InventoryCodeAndId = "itests"
Expand All @@ -123,7 +130,7 @@ public async Task Download_WithTransientFailure_Should_Retry_And_Succeed()

// First upload a file so we can download it
var inputContent = new string('z', 1_000_000);
var tempFile = Path.GetTempFileName();
var tempFile = Path.Combine(TestDirectory.FullName, Guid.NewGuid().ToString("N") + ".tmp");
await File.WriteAllTextAsync(tempFile, inputContent);

var uploader = uploaderFactory.Build(tempFile, shared);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using ByteSync.Client.IntegrationTests.TestHelpers;
using ByteSync.Common.Business.Inventories;
using ByteSync.Common.Business.SharedFiles;
using ByteSync.TestsCommon;
using ByteSync.DependencyInjection;
using ByteSync.Interfaces.Controls.Communications.Http;
using ByteSync.Interfaces.Factories;
Expand All @@ -19,13 +20,14 @@

namespace ByteSync.Client.IntegrationTests.Services.Communications.Transfers;

public class R2UploadDownload_Tests
public class R2UploadDownload_Tests : AbstractTester
{
private ILifetimeScope _clientScope = null!;

[SetUp]
public void SetUp()
{
CreateTestDirectory();
// ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
if (ByteSync.Services.ContainerProvider.Container == null)
{
Expand Down Expand Up @@ -93,7 +95,7 @@ public async Task Upload_Then_Download_Should_Succeed_With_Small_Chunks()
Source = new SharedDataPart
{
ClientInstanceId = shared.ClientInstanceId,
RootPath = Path.GetTempPath(),
RootPath = TestDirectory.FullName,
InventoryPartType = FileSystemTypes.File,
Name = "itests",
InventoryCodeAndId = "itests"
Expand All @@ -107,7 +109,7 @@ public async Task Upload_Then_Download_Should_Succeed_With_Small_Chunks()
sag.Targets.Add(new SharedDataPart
{
ClientInstanceId = shared.ClientInstanceId,
RootPath = Path.GetTempFileName(),
RootPath = Path.Combine(TestDirectory.FullName, Guid.NewGuid().ToString("N") + ".tmp"),
InventoryPartType = FileSystemTypes.File,
Name = "itests",
InventoryCodeAndId = "itests"
Expand All @@ -116,7 +118,7 @@ public async Task Upload_Then_Download_Should_Succeed_With_Small_Chunks()
sharedActionsGroupRepository.SetSharedActionsGroups([sag]);

var inputContent = new string('x', 1_000_000);
var tempFile = Path.GetTempFileName();
var tempFile = Path.Combine(TestDirectory.FullName, Guid.NewGuid().ToString("N") + ".tmp");
await File.WriteAllTextAsync(tempFile, inputContent);

var uploader = uploaderFactory.Build(tempFile, shared);
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 @@ -8,11 +8,12 @@
using Microsoft.Extensions.Logging;
using Moq;
using NUnit.Framework;
using ByteSync.TestsCommon;

namespace ByteSync.Client.UnitTests.Services.Communications.Transfers.Downloading;

[TestFixture]
public class SynchronizationDownloadFinalizerTests
public class SynchronizationDownloadFinalizerTests : AbstractTester
{
private Mock<IDeltaManager> _deltaManager = null!;
private Mock<ITemporaryFileManagerFactory> _temporaryFileManagerFactory = null!;
Expand All @@ -24,6 +25,7 @@ public class SynchronizationDownloadFinalizerTests
[SetUp]
public void Setup()
{
CreateTestDirectory();
_deltaManager = new Mock<IDeltaManager>(MockBehavior.Strict);
_temporaryFileManagerFactory = new Mock<ITemporaryFileManagerFactory>(MockBehavior.Strict);
_fileDatesSetter = new Mock<IFileDatesSetter>(MockBehavior.Strict);
Expand Down Expand Up @@ -276,15 +278,15 @@ private static void CreateEntryWithContent(ZipArchive archive, string entryName,
writer.Write(content);
}

private static string GetTempFilePath()
private string GetTempFilePath()
{
var path = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
var path = Path.Combine(TestDirectory.FullName, Guid.NewGuid().ToString("N"));

return path;
}

private static string GetNewTempPath(string extension)
private string GetNewTempPath(string extension)
{
return Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N") + extension);
return Path.Combine(TestDirectory.FullName, Guid.NewGuid().ToString("N") + extension);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,29 @@
using ByteSync.Models.Inventories;
using ByteSync.Services.Comparisons;
using FluentAssertions;
using ByteSync.TestsCommon;
using NUnit.Framework;

namespace ByteSync.Client.UnitTests.Services.Comparisons;

[TestFixture]
public class InventoryComparerIncompletePartsFlatTests
public class InventoryComparerIncompletePartsFlatTests : AbstractTester
{
private string _tempDirectory = null!;

[SetUp]
public void Setup()
{
_tempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
Directory.CreateDirectory(_tempDirectory);
CreateTestDirectory();
_tempDirectory = TestDirectory.FullName;
}

[TearDown]
public void TearDown()
{
if (Directory.Exists(_tempDirectory))
if (TestDirectory?.Exists == true)
{
Directory.Delete(_tempDirectory, true);
TestDirectory.Delete(true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,34 @@
using ByteSync.Models.FileSystems;
using ByteSync.Models.Inventories;
using ByteSync.Services.Comparisons;
using ByteSync.TestsCommon;
using FluentAssertions;
using NUnit.Framework;

namespace ByteSync.Client.UnitTests.Services.Comparisons;

[TestFixture]
public class InventoryComparerPropagateAccessIssuesTests
public class InventoryComparerPropagateAccessIssuesTests : AbstractTester
{
private string _tempDirectory = null!;

[SetUp]
public void Setup()
{
_tempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
Directory.CreateDirectory(_tempDirectory);
CreateTestDirectory();
_tempDirectory = TestDirectory.FullName;
}

[TearDown]
public void TearDown()
{
if (Directory.Exists(_tempDirectory))
if (TestDirectory?.Exists == true)
{
Directory.Delete(_tempDirectory, true);
TestDirectory.Delete(true);
}
}


private static string CreateInventoryZipFile(string directory, Inventory inventory)
{
var zipPath = Path.Combine(directory, $"{Guid.NewGuid()}.zip");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@
using FluentAssertions;
using Moq;
using NUnit.Framework;
using ByteSync.TestsCommon;

namespace ByteSync.Client.UnitTests.Services.Configurations;

[TestFixture]
public class LocalApplicationDataManagerTests
public class LocalApplicationDataManagerTests : AbstractTester
{
private Mock<IEnvironmentService> _environmentServiceMock = null!;

[SetUp]
public void SetUp()
{
CreateTestDirectory();
_environmentServiceMock = new Mock<IEnvironmentService>();
_environmentServiceMock.SetupGet(e => e.ExecutionMode).Returns(ExecutionMode.Regular);
_environmentServiceMock.SetupProperty(e => e.Arguments, []);
Expand Down Expand Up @@ -81,7 +83,7 @@
public void ApplicationDataPath_Should_Append_CustomSuffix_When_DebugArgumentProvided(OSPlatforms osPlatform)
{
// Arrange
var tempRoot = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
var tempRoot = TestDirectory.FullName;
Directory.CreateDirectory(tempRoot);
var assemblyDirectory = Directory.CreateDirectory(Path.Combine(tempRoot, "Portable")).FullName;
var assemblyPath = Path.Combine(assemblyDirectory, "ByteSync.exe");
Expand Down Expand Up @@ -131,7 +133,7 @@
public void ApplicationDataPath_Should_Create_DebugDirectory_When_DebugModeWithoutOverride(OSPlatforms osPlatform)
{
// Arrange
var tempRoot = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
var tempRoot = TestDirectory.FullName;
Directory.CreateDirectory(tempRoot);
var assemblyDirectory = Directory.CreateDirectory(Path.Combine(tempRoot, "Portable")).FullName;
var assemblyPath = Path.Combine(assemblyDirectory, "ByteSync.exe");
Expand Down Expand Up @@ -180,7 +182,7 @@
public void LogFilePath_Should_Return_MostRecent_Log_Excluding_Debug()
{
// Arrange
var tempRoot = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
var tempRoot = TestDirectory.FullName;
Directory.CreateDirectory(tempRoot);
var assemblyDirectory = Directory.CreateDirectory(Path.Combine(tempRoot, "Portable")).FullName;
var assemblyPath = Path.Combine(assemblyDirectory, "ByteSync.exe");
Expand Down Expand Up @@ -243,7 +245,7 @@
public void DebugLogFilePath_Should_Return_MostRecent_Debug_Log()
{
// Arrange
var tempRoot = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
var tempRoot = TestDirectory.FullName;
Directory.CreateDirectory(tempRoot);
var assemblyDirectory = Directory.CreateDirectory(Path.Combine(tempRoot, "Portable")).FullName;
var assemblyPath = Path.Combine(assemblyDirectory, "ByteSync.exe");
Expand Down Expand Up @@ -302,7 +304,7 @@
}
}

private static IDisposable OverrideCommandLineArgs(string[] args)

Check warning on line 307 in tests/ByteSync.Client.UnitTests/Services/Configurations/LocalApplicationDataManagerTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Change return type of method 'OverrideCommandLineArgs' from 'System.IDisposable' to 'ByteSync.Client.UnitTests.Services.Configurations.LocalApplicationDataManagerTests.DelegateDisposable' for improved performance

See more on https://sonarcloud.io/project/issues?id=POW-Software_ByteSync&issues=AZ1yb406bfjn6n6iAdMi&open=AZ1yb406bfjn6n6iAdMi&pullRequest=287
{
var field = typeof(Environment).GetField("s_commandLineArgs", BindingFlags.Static | BindingFlags.NonPublic);
if (field == null)
Expand Down
Loading
Loading