From b6a496e2dc3001c0fb263d74db4dd92ab35ece74 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Aug 2026 13:19:09 +0000 Subject: [PATCH 1/2] Initial plan From c47e8393c47742802874455174af8a4e079dd177 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Aug 2026 13:26:53 +0000 Subject: [PATCH 2/2] Apply remaining changes Co-authored-by: lukislp <155678024+lukislp@users.noreply.github.com> --- .../Services/Backup/DatabaseRestoreServiceTests.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/LagersystemLVHome.UnitTests/Services/Backup/DatabaseRestoreServiceTests.cs b/LagersystemLVHome.UnitTests/Services/Backup/DatabaseRestoreServiceTests.cs index 5904c08..da12388 100644 --- a/LagersystemLVHome.UnitTests/Services/Backup/DatabaseRestoreServiceTests.cs +++ b/LagersystemLVHome.UnitTests/Services/Backup/DatabaseRestoreServiceTests.cs @@ -398,7 +398,7 @@ public async Task RestoreFromBackupAsync_ValidUnencryptedBackup_RunsImportButFai var backupService = Substitute.For(); var sut = CreateSut(targetFactory, NewTempDir(), backupService: backupService); var progressEvents = new List(); - var progress = new Progress(p => progressEvents.Add(p)); + IProgress progress = new SyncProgress(p => progressEvents.Add(p)); var result = await sut.RestoreFromBackupAsync(new MemoryStream(zipBytes), progress: progress); @@ -528,6 +528,11 @@ public async Task CreateSafetyBackupAsync_CreatesSafetyDirectoryAndDelegatesToBa path.Should().StartWith(Path.Combine(webRoot, "backups", "safety")); Directory.Exists(Path.Combine(webRoot, "backups", "safety")).Should().BeTrue(); - await backupService.Received(1).CreateBackupAsync(Arg.Any()); } } + +/// Invokes the progress handler synchronously on the calling thread, avoiding the async dispatch of . +file sealed class SyncProgress(Action handler) : IProgress +{ + public void Report(T value) => handler(value); +}