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:
Alby96andClaude Opus 5.5 committed 2026-11-17 21:58:58 +01:00
1 parent bf7701d279
commit 38764972ad
77 files changed
+965 -123

No files matched your search

@@ -127,7 +127,7 @@ public sealed class SyncServiceCopyTests(TestContext context)
await f.RefreshAsync();
Assert.Equal(SyncStatus.InSync, (await f.EntryAsync("Comet")).Status);
await f.Sync.UnlinkAsync(f.Server, remote.Id, f.Ct);
await f.Sync.UnlinkAsync(f.Server, remote.Id, local.Id, f.Ct);
var link = await f.Sync.Links.GetAsync(f.Server, remote.Id, f.Ct);
Assert.NotNull(link);
@@ -244,6 +244,43 @@ public sealed class SyncServiceCopyTests(TestContext context)
Assert.True((await f.Sync.Copies.ListByServerAsync(nas.Server, f.Ct)).All(p => p.RemoteGoneHits == 0));
}
[Test]
public async Task ASweepOf404sConfirmsNoEarlierHitEither()
{
await using var f = await SyncFixture.CreateAsync(context);
var nas = new FakeSyncRemote { Server = HomeFolders.IdKey(Guid.NewGuid()) };
// One pair with a 404 counted more than ten minutes ago (its link already forgotten).
var first = f.NewPhotos(2);
var gone = await f.LocalAsync("Comet", first);
var goneRemote = nas.Add("Comet", first);
await f.Sync.LinkAsync(nas.Server, goneRemote.Id, gone.Id, f.Ct);
await f.Sync.RefreshAsync(nas, new SyncPolicy(), f.Ct);
nas.Sequences.Remove(goneRemote.Id);
await f.Sync.RefreshAsync(nas, new SyncPolicy(), f.Ct);
var pair = (await f.Sync.Copies.ListByServerAsync(nas.Server, f.Ct)).Single(p => p.LocalId == gone.Id);
Assert.Equal(1, pair.RemoteGoneHits);
await using (var session = await f.Db.Database.OpenAsync(f.Ct))
await session.ExecuteAsync("UPDATE found_copies SET remote_gone_at = $1 WHERE id = $2", [DateTimeOffset.UtcNow.AddMinutes(-11), pair.Id], f.Ct);
// Then the server serves something else: every linked sequence answers 404 at once.
var remotes = new List<FakeSequence>();
for (var i = 0; i < 5; i++)
{
var photos = f.NewPhotos(1);
var local = await f.LocalAsync($"Card {i}", photos);
var remote = nas.Add($"Card {i}", photos);
await f.Sync.LinkAsync(nas.Server, remote.Id, local.Id, f.Ct);
remotes.Add(remote);
}
foreach (var remote in remotes) nas.Sequences.Remove(remote.Id);
await f.Sync.RefreshAsync(nas, new SyncPolicy(), f.Ct);
pair = (await f.Sync.Copies.GetAsync(pair.Id, f.Ct))!;
Assert.Equal(1, pair.RemoteGoneHits);
Assert.False(pair.RemoteGone);
}
[Test]
public async Task AServerKnownOnlyByItsAddressMarksNothing()
{