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
@@ -730,6 +730,36 @@ public sealed class IntegrateTests(TestContext context)
|
||||
Assert.False(File.Exists(IntegrateJournal.PathFor(f.Archive.Paths, job.Id)));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task ALinkTheUserGaveTheServerSequenceAfterTheJournalIsNeverUndoneOnResume()
|
||||
{
|
||||
await using var f = await FixtureAsync(context);
|
||||
var (engine, handler) = Engine(f);
|
||||
await using var _ = engine;
|
||||
await engine.StartAsync(f.Ct);
|
||||
var (local, remote, pair) = await ScenarioAsync(f);
|
||||
var other = await LocalAsync(f, "Comet copy", [(1, 0, "IMG_0001.JPG")]);
|
||||
handler.BeforeStage = stage => stage == IntegrateStage.Link ? throw new IOException("crash before Link") : Task.CompletedTask;
|
||||
var plan = await Planner(f).PlanAsync(f.Remote, pair, await ChoicesAsync(f, local.Id, remote.Id, CopyPhotoPolicy.Union), PlanContext(), f.Ct);
|
||||
var job = await CopyJobs.EnqueueIntegrateAsync(engine, f.Sync.Copies, plan, local.DisplayTitle, f.Ct);
|
||||
await f.Archive.WaitForAsync(job.Id, JobState.Failed);
|
||||
Assert.True(File.Exists(IntegrateJournal.PathFor(f.Archive.Paths, job.Id)));
|
||||
|
||||
// Meanwhile the user links the server sequence to another copy of this PC.
|
||||
await f.Sync.LinkAsync(f.Server, remote.Id, other.Id, f.Ct);
|
||||
handler.BeforeStage = null;
|
||||
var uploads = f.Remote.IntoUploads;
|
||||
await engine.ResumeAsync(job.Id, f.Ct);
|
||||
var failed = await f.Archive.WaitForAsync(job.Id, JobState.Failed);
|
||||
|
||||
Assert.Equal(Loc.L("Errors.Copies.StalePlan"), failed.Error);
|
||||
Assert.Equal(other.Id, (await f.Sync.Links.GetAsync(f.Server, remote.Id, f.Ct))!.LocalId);
|
||||
Assert.Null(await f.Sync.LinkOfAsync(f.Server, local.Id, f.Ct));
|
||||
Assert.Equal(uploads, f.Remote.IntoUploads);
|
||||
Assert.False(File.Exists(IntegrateJournal.PathFor(f.Archive.Paths, job.Id)));
|
||||
Assert.NotEqual(CopyState.Integrating, (await f.Sync.Copies.GetAsync(pair.Id, f.Ct))!.State);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task ARetryAfterAFailureBeforeTheJournalRunsTheIntegrate()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user