Skip to content
Merged
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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
9 changes: 5 additions & 4 deletions src/WinRestoreKit.Tests/RestoreSetViewModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace WinRestoreKit.Tests
public sealed class RestoreSetViewModelTests
{
[Fact]
public void RestoreSet_AcceptsOnlyComparableRowsWithUsableArtifacts()
public void RestoreSet_AcceptsEveryUsableArtifactEvenWhenDriftIsUnavailable()
{
WpfTestHost.Run(() =>
{
Expand All @@ -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));
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/WinRestoreKit.Tests/SnapshotComparisonServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand All @@ -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);
}
}

Expand Down
Loading