fix(copies): close the sixth verification round of owner review 6
A merge that finds the other changed drops its journal so the retry plans again. Unlink and Keep apart name the local side and leave a link that now joins another sequence alone; Link only and the Integrate job refuse to touch a link or a pair another integration holds. A sweep of 404s asks the server once. To trash... trashes from the kept sequence after a swap and every trash re-checks for new last copies. The Compare dialog and Settings choices fit in every language, Details segments say which value they take, twins need their sibling at the other home, and a linked row keeps three buttons. Captures updated for the dialog and Settings scenes. Refs #73 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bf7701d279
commit
38764972ad
77 files changed
+965
-123
No files matched your search
@@ -300,6 +300,16 @@ internal sealed class MergeJobHandler(ChronosDatabase db, SequenceMerger merger,
|
||||
|
||||
private InvalidOperationException Changed(string title) => new(Loc.L("Errors.Copies.Changed", title));
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="Changed"/> for a change that never goes back (a frames version, a photo gone from the kept sequence):
|
||||
/// retrying this journal would fail the same way, so it goes and the next run plans again.
|
||||
/// </summary>
|
||||
private InvalidOperationException Stale(string title)
|
||||
{
|
||||
ForgetJournal();
|
||||
return Changed(title);
|
||||
}
|
||||
|
||||
/// <summary>Asks for this run's journal and staging to go as it fails (<see cref="AbandonAsync"/>): what it planned no longer holds.</summary>
|
||||
private void ForgetJournal() => _forget = true;
|
||||
|
||||
@@ -344,7 +354,7 @@ internal sealed class MergeJobHandler(ChronosDatabase db, SequenceMerger merger,
|
||||
private async Task EnsureDropUnchangedAsync(int expected)
|
||||
{
|
||||
var drop = await _db.Sequences.GetAsync(journal.DropId, _ct).ConfigureAwait(false);
|
||||
if (drop is null || drop.FramesVersion != expected) throw Changed(_dropTitle);
|
||||
if (drop is null || drop.FramesVersion != expected) throw Stale(_dropTitle);
|
||||
}
|
||||
|
||||
// ---- copy ----
|
||||
@@ -401,7 +411,7 @@ internal sealed class MergeJobHandler(ChronosDatabase db, SequenceMerger merger,
|
||||
catch (PhotoRemovedException)
|
||||
{
|
||||
File.Delete(staged);
|
||||
if (planned) throw Changed(_keepTitle); // deleted from the kept sequence since the plan: a last copy the plan did not list
|
||||
if (planned) throw Stale(_keepTitle); // deleted from the kept sequence since the plan: a last copy the plan did not list
|
||||
// A photo the plan could not compare by content (unhashed) that the kept sequence deleted: a last copy the
|
||||
// plan did not list. Retrying this journal would fail the same way: it goes, and the user plans again.
|
||||
ForgetJournal();
|
||||
@@ -516,7 +526,7 @@ internal sealed class MergeJobHandler(ChronosDatabase db, SequenceMerger merger,
|
||||
private async Task VerifyAsync()
|
||||
{
|
||||
var drop = await _db.Sequences.GetAsync(journal.DropId, _ct).ConfigureAwait(false) ?? throw Changed(_dropTitle);
|
||||
if (drop.FramesVersion != journal.DropFramesVersion) throw Changed(_dropTitle);
|
||||
if (drop.FramesVersion != journal.DropFramesVersion) throw Stale(_dropTitle);
|
||||
EnsureDropReadable(drop);
|
||||
await EnsureFolderReadAsync(drop).ConfigureAwait(false);
|
||||
var keepFrames = await ProcessingFrames.ListAsync(_db, journal.KeepId, _ct).ConfigureAwait(false);
|
||||
@@ -920,8 +930,8 @@ internal sealed class MergeJobHandler(ChronosDatabase db, SequenceMerger merger,
|
||||
ForgetJournal();
|
||||
throw Changed(_dropTitle);
|
||||
}
|
||||
var expected = journal.VerifiedDropFramesVersion ?? throw Changed(_dropTitle);
|
||||
if (drop.FramesVersion != expected) throw Changed(_dropTitle);
|
||||
var expected = journal.VerifiedDropFramesVersion ?? throw Stale(_dropTitle);
|
||||
if (drop.FramesVersion != expected) throw Stale(_dropTitle);
|
||||
EnsureDropReadable(drop);
|
||||
if (beforeLinks) await EnsureFolderReadAsync(drop).ConfigureAwait(false);
|
||||
return expected;
|
||||
@@ -998,7 +1008,7 @@ internal sealed class MergeJobHandler(ChronosDatabase db, SequenceMerger merger,
|
||||
// folder) never lets the rest through unread.
|
||||
var dropFrames = await ProcessingFrames.ListAsync(_db, journal.DropId, _ct).ConfigureAwait(false);
|
||||
if (dropFrames.Any(f => (f.Flags & CopySides.UnusableFlags) == 0 && !journal.Verified.ContainsKey(f.Id) && !journal.Settled.Contains(f.Id)))
|
||||
throw Changed(_dropTitle);
|
||||
throw Stale(_dropTitle);
|
||||
// A frame flagged Missing or Corrupt since the verify, its file there: never hashed as such, so planned again.
|
||||
if (dropFrames.Any(f => (f.Flags & CopySides.UnusableFlags) != 0 && !journal.FlaggedVerified.Contains(f.Id)
|
||||
&& File.Exists(_dropPaths.FromRelative(f.RelativePath))))
|
||||
@@ -1028,7 +1038,7 @@ internal sealed class MergeJobHandler(ChronosDatabase db, SequenceMerger merger,
|
||||
&& (frame.Sha256 is null || string.Equals(frame.Sha256, verified.Sha256, StringComparison.OrdinalIgnoreCase)))
|
||||
continue;
|
||||
if (hashes.Contains(verified.Sha256)) continue;
|
||||
throw Changed(_keepTitle);
|
||||
throw Stale(_keepTitle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user