diff --git a/CHANGELOG.md b/CHANGELOG.md index 11b7f1a..970b3af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,8 +21,8 @@ version numbers, because that is what those releases were called. ### Fixed: restore and snapshot integrity -- Verified successful manifest rows against their physical artifacts and kept unavailable modules out - of restore sets, preventing stale metadata from authorizing an unsafe restore. +- Verified successful manifest rows against their physical artifacts and admitted only rows with a + usable artifact, including modules whose live drift cannot be compared safely. - Read the selected app export directly from its prepared payload and exposed friendly source names in the reinstall picker. - Created a fresh, second-precision folder for every user backup and reserved collision suffixes diff --git a/src/WinRestoreKit.Application/Comparison/ModuleComparison.cs b/src/WinRestoreKit.Application/Comparison/ModuleComparison.cs index 541c4e4..7c8aff3 100644 --- a/src/WinRestoreKit.Application/Comparison/ModuleComparison.cs +++ b/src/WinRestoreKit.Application/Comparison/ModuleComparison.cs @@ -21,7 +21,6 @@ internal ModuleComparison(BackupBase module, ComparisonState state, public bool HasUsableArtifact { get; } public bool CanRestore => HasUsableArtifact - && State != ComparisonState.Unavailable && State != ComparisonState.NotCaptured; public string ArtifactSummary { get; } diff --git a/src/WinRestoreKit.Tests/RestoreSetViewModelTests.cs b/src/WinRestoreKit.Tests/RestoreSetViewModelTests.cs index 3b7574b..f43c2b3 100644 --- a/src/WinRestoreKit.Tests/RestoreSetViewModelTests.cs +++ b/src/WinRestoreKit.Tests/RestoreSetViewModelTests.cs @@ -7,7 +7,7 @@ namespace WinRestoreKit.Tests public sealed class RestoreSetViewModelTests { [Fact] - public void RestoreSet_AcceptsOnlyComparableRowsWithUsableArtifacts() + public void RestoreSet_AcceptsEveryUsableArtifactEvenWhenDriftIsUnavailable() { WpfTestHost.Run(() => { @@ -26,9 +26,10 @@ public void RestoreSet_AcceptsOnlyComparableRowsWithUsableArtifacts() restoreSet.Add(changed); restoreSet.Add(absent); - Assert.Single(restoreSet.Modules); - Assert.Same(usableModule, restoreSet.Modules[0]); - Assert.False(restoreSet.Contains(unavailableModule)); + Assert.Collection(restoreSet.Modules, + module => Assert.Same(unavailableModule, module), + module => Assert.Same(usableModule, module)); + Assert.True(restoreSet.Contains(unavailableModule)); Assert.False(restoreSet.Contains(absentModule)); }); } diff --git a/src/WinRestoreKit.Tests/SnapshotComparisonServiceTests.cs b/src/WinRestoreKit.Tests/SnapshotComparisonServiceTests.cs index 3f0c8f9..a3fb644 100644 --- a/src/WinRestoreKit.Tests/SnapshotComparisonServiceTests.cs +++ b/src/WinRestoreKit.Tests/SnapshotComparisonServiceTests.cs @@ -144,7 +144,7 @@ public async Task CompareAsync_ArtifactProbeException_IsUnavailableWithoutDriftP } [Fact] - public async Task CompareAsync_IndeterminateDrift_StaysUnavailableWithUsableArtifact() + public async Task CompareAsync_IndeterminateDrift_RemainsRestorableWithUsableArtifact() { using (TestDirectory backup = TestDirectory.Create()) { @@ -155,7 +155,7 @@ public async Task CompareAsync_IndeterminateDrift_StaysUnavailableWithUsableArti Assert.Equal(ComparisonState.Unavailable, row.State); Assert.True(row.HasUsableArtifact); - Assert.False(row.CanRestore); + Assert.True(row.CanRestore); } }