fix(archive): settle conversions by content and keep their aliases through trash, undo, sync and ingest
Owner review 2, phase 4b, fix round 1 (trash, undo, recovery, sync and ingest). - Replace journal: records a phase (moving, written, undoing) and the name each swapped frame is filed under. Recovery decides "sidecar written" by what the sidecar lists, not by the frames version any writer moves; a failed rollback stays undoing and its failure now stops the writer (as a photo deletion's recovery does). The ingest settles restores and replacements first, so an upload can no longer complete a swap that never happened. - Emptying a Replaced entry re-verifies each replacement where it is now: in the sequence through later conversions (a second conversion no longer strands the first originals), or, when the conversion was deleted, its copy in the trash. The dry run marks such entries "conversion deleted" (fingerprinted, shown on the desktop and the panel), and the confirmed emptying may then erase them instead of keeping them forever. - Undo of a conversion takes exactly the entries its job made (the job id is recorded on the entry), never entries found by time window. - Project positions translated by photo use the sidecar's photo of every frame still there, so positions on a converted frame stay put when another frame went meanwhile. - Sync aliases are equivalence classes: an original converted on both sides is one photo; link-by-content, proxy counting and proxy upload follow aliases; a download into a frame missing here swaps the other encoding into that frame instead of adding a frame. - The ingest answers a converted photo's original (a card or folder imported again, a download) as a duplicate of its conversion and keeps the alias tombstone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 3341a2f845753fc4c5bcba51a3b645f126c95eaf)
This commit is contained in:
1 parent
67a6d51cbe
commit
d0bbd77c92
31 files changed
+1326
-211
No files matched your search
@@ -439,21 +439,21 @@ public abstract class FrameTrashTests(TestContext context) : DatabaseTest(contex
|
||||
var (sequence, frames) = await UploadedAsync(fx, 2);
|
||||
var replacement = frames[1];
|
||||
var good = WriteReplaced(fx, sequence, "20261027100000", replacement.Sha256!);
|
||||
var bad = WriteReplaced(fx, sequence, "20261027110000", new string('a', 64));
|
||||
// A replacement no frame of the sequence holds any more (its conversion deleted and erased): the dry run says so, and
|
||||
// the emptying confirmed with it erases the originals (owner review 2, R7).
|
||||
var gone = WriteReplaced(fx, sequence, "20261027110000", new string('a', 64));
|
||||
var engine = await fx.StartEngineAsync();
|
||||
var listed = await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct);
|
||||
Assert.True(listed.All(e => e.Kind == TrashKind.Replaced));
|
||||
|
||||
var plan = await fx.Service.PlanEmptyTrashAsync(fx.Archive.Id, null, fx.Ct);
|
||||
Assert.True(plan.Entries.Single(e => e.Name == FrameTrash.EntryPrefix + gone).ConversionDeleted);
|
||||
Assert.False(plan.Entries.Single(e => e.Name == FrameTrash.EntryPrefix + good).ConversionDeleted);
|
||||
var job = await engine.EnqueueAsync(ArchiveJobs.EmptyTrash(fx.Archive, plan), cancellationToken: fx.Ct);
|
||||
var failed = await fx.WaitForAsync(job.Id, JobState.Failed);
|
||||
await fx.WaitForAsync(job.Id, JobState.Done);
|
||||
Assert.Empty(await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct));
|
||||
|
||||
Assert.Equal(Chronos.Core.Localization.Loc.Plural("Archive.Error.TrashKept", 1), failed.Error);
|
||||
var left = Assert.Contains(await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct), e => e.Name == FrameTrash.EntryPrefix + bad);
|
||||
Assert.Equal(TrashKind.Replaced, left.Kind);
|
||||
Assert.DoesNotContain(FrameTrash.EntryPrefix + good, (await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct)).Select(e => e.Name));
|
||||
|
||||
// A replacement whose file no longer hashes to it keeps its originals too.
|
||||
// A replacement whose file no longer hashes to it keeps its originals.
|
||||
var other = WriteReplaced(fx, sequence, "20261027120000", replacement.Sha256!);
|
||||
var file = fx.Paths.FromRelative(replacement.RelativePath);
|
||||
var bytes = File.ReadAllBytes(file);
|
||||
|
||||
@@ -0,0 +1,374 @@
|
||||
using System.Security.Cryptography;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Import;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Data.Archiving.Jobs;
|
||||
using Chronos.Data.Repositories;
|
||||
using Chronos.Testing;
|
||||
using static Chronos.Data.Tests.Archiving.ArchiveFixture;
|
||||
|
||||
namespace Chronos.Data.Tests.Archiving;
|
||||
|
||||
/// <summary>
|
||||
/// Frames whose files a conversion replaced (owner review 2, R7) and everything that meets them afterwards: a replacement
|
||||
/// that could not be undone, a second conversion, the conversion deleted, the trash emptied, the job that made an entry,
|
||||
/// project positions, and the original filed again.
|
||||
/// </summary>
|
||||
[Category("archive")]
|
||||
public sealed class ReplacedTrashTests(TestContext context)
|
||||
{
|
||||
/// <summary>A sequence of <paramref name="count"/> uploaded photos ten seconds apart, and their bytes.</summary>
|
||||
private static async Task<(Guid Id, List<byte[]> Photos)> UploadedAsync(ArchiveFixture fx, int count, string session = "upload-1")
|
||||
{
|
||||
Guid? id = null;
|
||||
var photos = new List<byte[]>();
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var bytes = Photos.Jpeg(Start.AddSeconds(10 * i), 100 + i);
|
||||
photos.Add(bytes);
|
||||
id = (await CommitAsync(fx, id, id is null ? session : null, bytes, $"IMG_{i + 1:0000}.JPG")).SequenceId;
|
||||
}
|
||||
return (id!.Value, photos);
|
||||
}
|
||||
|
||||
private static Task<IngestResult> CommitAsync(ArchiveFixture fx, Guid? sequenceId, string? session, byte[] bytes, string name)
|
||||
{
|
||||
var staging = Path.Combine(fx.Paths.StagingDirectory, "uploads");
|
||||
Directory.CreateDirectory(staging);
|
||||
var path = Path.Combine(staging, $"{Guid.NewGuid():N}.part");
|
||||
File.WriteAllBytes(path, bytes);
|
||||
return fx.Service.Ingest.CommitAsync(new IngestRequest(fx.Archive.Id, sequenceId, null, sequenceId is null ? session : null, path, name, bytes.Length,
|
||||
Sha(bytes), null, null), fx.Ct);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replaces the files of the frames at <paramref name="indices"/> (in the sidecar now) with other photos, as a
|
||||
/// conversion's stage B does (<see cref="FrameTrash.ReplaceAsync"/>); returns the trash entry of the originals.
|
||||
/// </summary>
|
||||
private static async Task<TrashEntry> ReplaceAsync(ArchiveFixture fx, Guid sequenceId, IReadOnlyList<int> indices, int seed, Guid? job = null)
|
||||
{
|
||||
var sequence = (await fx.Db.Sequences.GetAsync(sequenceId))!;
|
||||
var manifest = Sidecar(fx, sequence);
|
||||
var staging = Path.Combine(fx.Paths.StagingDirectory, "replace-test");
|
||||
Directory.CreateDirectory(staging);
|
||||
var swaps = new List<FrameSwap>();
|
||||
foreach (var i in indices)
|
||||
{
|
||||
var frame = manifest.Frames[i];
|
||||
var bytes = Photos.Jpeg(frame.CapturedAt, seed + i);
|
||||
var path = Path.Combine(staging, $"{Guid.NewGuid():N}.jpeg");
|
||||
File.WriteAllBytes(path, bytes);
|
||||
var sha = Sha(bytes);
|
||||
swaps.Add(new FrameSwap(frame.Id, fx.Paths.ToRelative(path), [], (current, _) => Path.ChangeExtension(current.File, ".jpeg"), current => current with
|
||||
{
|
||||
Sha256 = sha,
|
||||
Size = bytes.Length,
|
||||
Source = new FrameSource { Sha256 = current.Sha256, Format = current.Format, File = current.File, Size = current.Size },
|
||||
}));
|
||||
}
|
||||
var result = Assert.NotNull(await fx.Service.FrameTrash.ReplaceAsync(fx.Archive, sequenceId, null, swaps, null, job, null, null, fx.Ct));
|
||||
return Assert.NotNull(result.Entry);
|
||||
}
|
||||
|
||||
private static SequenceManifest Sidecar(ArchiveFixture fx, Sequence sequence) => ManifestStore.ReadSequence(fx.Paths.Sequence(sequence.Folder).ManifestPath);
|
||||
|
||||
private static string Sha(byte[] bytes) => Convert.ToHexStringLower(SHA256.HashData(bytes));
|
||||
|
||||
private static string Sha(string path) => Sha(File.ReadAllBytes(path));
|
||||
|
||||
private static async Task<Job> EmptyAsync(ArchiveFixture fx, Chronos.Data.Jobs.JobEngine engine, TrashEmptyPlan plan, JobState state)
|
||||
{
|
||||
var job = await engine.EnqueueAsync(ArchiveJobs.EmptyTrash(fx.Archive, plan), cancellationToken: fx.Ct);
|
||||
return await fx.WaitForAsync(job.Id, state);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task AReplacementThatCouldNotBeUndoneIsUndoneBeforeAnythingElseIsFiled()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var (id, _) = await UploadedAsync(fx, 2);
|
||||
var sequence = (await fx.Db.Sequences.GetAsync(id))!;
|
||||
var folder = fx.Paths.Sequence(sequence.Folder);
|
||||
var manifest = Sidecar(fx, sequence);
|
||||
var frame = manifest.Frames[0];
|
||||
// A replacement that failed and whose undo failed too: the original in its entry, the converted file in the sequence,
|
||||
// the record pending, the sidecar as it was, and the folder the converted file must go back to taken by a file.
|
||||
var staging = Path.Combine(fx.Paths.StagingDirectory, "convert-test");
|
||||
var staged = Path.Combine(staging, "converted.jpeg");
|
||||
var converted = Photos.Jpeg(frame.CapturedAt, 900);
|
||||
var entryFolder = Path.Combine(FrameTrash.Directory(fx.Paths), $"{id:N}-20261027120000");
|
||||
var record = entryFolder + ".json";
|
||||
var trashed = Path.Combine(entryFolder, "originals", Path.GetFileName(frame.File));
|
||||
var placed = Path.ChangeExtension(frame.File, ".jpeg");
|
||||
new FrameReplaceJournal(manifest.Versions.Frames, fx.Paths.ToRelative(record), fx.Paths.ToRelative(entryFolder),
|
||||
[new SwapMove(frame.File, fx.Paths.ToRelative(trashed))], [new SwapMove(placed, fx.Paths.ToRelative(staged))], false, null)
|
||||
{
|
||||
Names = new Dictionary<Guid, string> { [frame.Id] = placed },
|
||||
}.Write(folder);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(trashed)!);
|
||||
File.WriteAllText(FrameRemovalJournal.PendingRecord(record), "{}");
|
||||
File.Move(folder.File(frame.File), trashed);
|
||||
File.WriteAllBytes(folder.File(placed), converted);
|
||||
Directory.CreateDirectory(fx.Paths.StagingDirectory);
|
||||
File.WriteAllText(staging, "in the way");
|
||||
|
||||
// An upload into the sequence meanwhile: the undo fails again, and nothing is filed.
|
||||
await Assert.ThrowsAsync<IOException>(() => CommitAsync(fx, id, null, Photos.Jpeg(Start.AddSeconds(30), 300), "IMG_0003.JPG"));
|
||||
Assert.Equal(manifest.Versions.Frames, Sidecar(fx, sequence).Versions.Frames);
|
||||
Assert.Equal(ReplacePhase.Undoing, Assert.NotNull(FrameReplaceJournal.Read(folder)).Phase);
|
||||
Assert.Empty(await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct));
|
||||
|
||||
// Another writer of an earlier build moved the frames version meanwhile: the replacement is undone all the same, never
|
||||
// taken for one whose sidecar was written.
|
||||
ManifestStore.WriteSequence(folder.ManifestPath, manifest with { Versions = manifest.Versions with { Frames = manifest.Versions.Frames + 1 } });
|
||||
File.Delete(staging);
|
||||
await fx.Service.EditSequenceInfoAsync(id, info => info with { Rating = 2 }, fx.Ct);
|
||||
Assert.FileMissing(folder.ReplaceJournalPath);
|
||||
Assert.Equal(frame.Sha256, Sha(folder.File(frame.File)));
|
||||
Assert.FileMissing(folder.File(placed));
|
||||
Assert.Equal(Sha(converted), Sha(staged));
|
||||
Assert.False(Directory.Exists(entryFolder));
|
||||
Assert.FileMissing(FrameRemovalJournal.PendingRecord(record));
|
||||
Assert.Empty(await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct));
|
||||
Assert.SequenceEqual(manifest.Frames.Select(f => (f.Id, f.File, f.Sha256)), Sidecar(fx, sequence).Frames.Select(f => (f.Id, f.File, f.Sha256)));
|
||||
|
||||
// Settled, the upload goes in.
|
||||
await CommitAsync(fx, id, null, Photos.Jpeg(Start.AddSeconds(30), 300), "IMG_0003.JPG");
|
||||
Assert.Count(3, Sidecar(fx, sequence).Frames);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task AnInterruptedReplacementIsSettledByWhatItsSidecarLists()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var (id, _) = await UploadedAsync(fx, 2);
|
||||
var entry = await ReplaceAsync(fx, id, [0], 500);
|
||||
var sequence = (await fx.Db.Sequences.GetAsync(id))!;
|
||||
var folder = fx.Paths.Sequence(sequence.Folder);
|
||||
var manifest = Sidecar(fx, sequence);
|
||||
var (entryFolder, record) = FrameTrash.Location(fx.Paths, entry.Name);
|
||||
// As a crash right after the sidecar was written leaves it (at the version an ingest would give too): completed.
|
||||
File.Move(record, FrameRemovalJournal.PendingRecord(record));
|
||||
new FrameReplaceJournal(manifest.Versions.Frames - 1, fx.Paths.ToRelative(record), fx.Paths.ToRelative(entryFolder), [], [], false, null)
|
||||
{
|
||||
Names = new Dictionary<Guid, string> { [manifest.Frames[0].Id] = manifest.Frames[0].File },
|
||||
}.Write(folder);
|
||||
Assert.Empty(await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct));
|
||||
await fx.Service.EditSequenceInfoAsync(id, info => info with { Rating = 2 }, fx.Ct);
|
||||
Assert.FileMissing(folder.ReplaceJournalPath);
|
||||
Assert.Equal(entry.Name, (await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct)).Single().Name);
|
||||
|
||||
// As a crash before the sidecar was written leaves it, with the frames version moved by another writer since: undone.
|
||||
manifest = Sidecar(fx, sequence);
|
||||
var frame = manifest.Frames[1];
|
||||
var staged = Path.Combine(fx.Paths.StagingDirectory, "convert-test", "converted.jpeg");
|
||||
var converted = Photos.Jpeg(frame.CapturedAt, 901);
|
||||
var second = Path.Combine(FrameTrash.Directory(fx.Paths), $"{id:N}-20261027130000");
|
||||
var trashed = Path.Combine(second, "originals", Path.GetFileName(frame.File));
|
||||
var placed = Path.ChangeExtension(frame.File, ".jpeg");
|
||||
new FrameReplaceJournal(manifest.Versions.Frames, fx.Paths.ToRelative(second + ".json"), fx.Paths.ToRelative(second),
|
||||
[new SwapMove(frame.File, fx.Paths.ToRelative(trashed))], [new SwapMove(placed, fx.Paths.ToRelative(staged))], false, null)
|
||||
{
|
||||
Names = new Dictionary<Guid, string> { [frame.Id] = placed },
|
||||
}.Write(folder);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(trashed)!);
|
||||
File.WriteAllText(FrameRemovalJournal.PendingRecord(second + ".json"), "{}");
|
||||
File.Move(folder.File(frame.File), trashed);
|
||||
File.WriteAllBytes(folder.File(placed), converted);
|
||||
ManifestStore.WriteSequence(folder.ManifestPath, manifest with { Versions = manifest.Versions with { Frames = manifest.Versions.Frames + 1 } });
|
||||
|
||||
await fx.Service.EditSequenceInfoAsync(id, info => info with { Rating = 3 }, fx.Ct);
|
||||
Assert.FileMissing(folder.ReplaceJournalPath);
|
||||
Assert.Equal(frame.Sha256, Sha(folder.File(frame.File)));
|
||||
Assert.FileMissing(folder.File(placed));
|
||||
Assert.Equal(Sha(converted), Sha(staged));
|
||||
Assert.False(Directory.Exists(second));
|
||||
Assert.Equal(entry.Name, (await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct)).Single().Name);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task OriginalsConvertedTwiceAreErasedWhileTheLastConversionHolds()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var (id, _) = await UploadedAsync(fx, 2);
|
||||
var engine = await fx.StartEngineAsync();
|
||||
await ReplaceAsync(fx, id, [0, 1], 500);
|
||||
await ReplaceAsync(fx, id, [0, 1], 600);
|
||||
var sequence = (await fx.Db.Sequences.GetAsync(id))!;
|
||||
var current = fx.Paths.Sequence(sequence.Folder).File(Sidecar(fx, sequence).Frames[0].File);
|
||||
var bytes = File.ReadAllBytes(current);
|
||||
|
||||
// The last conversion damaged: neither the originals nor the first conversion go.
|
||||
var damaged = (byte[])bytes.Clone();
|
||||
damaged[^10] ^= 0x01;
|
||||
File.WriteAllBytes(current, damaged);
|
||||
var plan = await fx.Service.PlanEmptyTrashAsync(fx.Archive.Id, null, fx.Ct);
|
||||
Assert.Count(2, plan.Entries);
|
||||
Assert.True(plan.Entries.All(e => !e.ConversionDeleted), "the conversions are in the sequence");
|
||||
await EmptyAsync(fx, engine, plan, JobState.Failed);
|
||||
Assert.Count(2, await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct));
|
||||
|
||||
// Whole again: the first originals are held by the second conversion, through the first one's tombstone.
|
||||
File.WriteAllBytes(current, bytes);
|
||||
await EmptyAsync(fx, engine, await fx.Service.PlanEmptyTrashAsync(fx.Archive.Id, null, fx.Ct), JobState.Done);
|
||||
Assert.Empty(await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task OriginalsWhoseConversionWasDeletedAreErasedAsTheDryRunSays()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var (id, _) = await UploadedAsync(fx, 3);
|
||||
var engine = await fx.StartEngineAsync();
|
||||
var replaced = await ReplaceAsync(fx, id, [0], 500);
|
||||
var before = await fx.Service.PlanEmptyTrashAsync(fx.Archive.Id, null, fx.Ct);
|
||||
Assert.False(before.Entries.Single().ConversionDeleted);
|
||||
|
||||
// The user deletes the converted photo.
|
||||
var frames = await fx.Db.Frames.ListBySequenceAsync(id);
|
||||
var sequence = (await fx.Db.Sequences.GetAsync(id))!;
|
||||
var deletion = await fx.Service.FrameTrash.DeleteAsync(await fx.Service.FrameTrash.PlanDeleteAsync(id, [frames[0].Id], sequence.FramesVersion, fx.Ct),
|
||||
null, null, fx.Ct);
|
||||
|
||||
// The plan made before no longer holds: nothing is erased.
|
||||
await EmptyAsync(fx, engine, before, JobState.Failed);
|
||||
Assert.Count(2, await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct));
|
||||
|
||||
var plan = await fx.Service.PlanEmptyTrashAsync(fx.Archive.Id, null, fx.Ct);
|
||||
Assert.True(plan.Entries.Single(e => e.Name == replaced.Name).ConversionDeleted, "the dry run says the conversion was deleted");
|
||||
Assert.False(plan.Entries.Single(e => e.Name == deletion.Entry.Name).ConversionDeleted);
|
||||
Assert.NotEqual(SequenceTrash.EntryFingerprint(plan.Entries.Single(e => e.Name == replaced.Name) with { ConversionDeleted = false }),
|
||||
SequenceTrash.EntryFingerprint(plan.Entries.Single(e => e.Name == replaced.Name)));
|
||||
|
||||
// The deleted conversion is still in the trash, damaged: the originals stay.
|
||||
var record = Assert.NotNull(FrameTrash.ReadEntry(fx.Paths, deletion.Entry.Name));
|
||||
var copy = Path.Combine(FrameTrash.Location(fx.Paths, deletion.Entry.Name).Folder, record.Photos[0].Files[0].Path);
|
||||
var bytes = File.ReadAllBytes(copy);
|
||||
var damaged = (byte[])bytes.Clone();
|
||||
damaged[^10] ^= 0x01;
|
||||
File.WriteAllBytes(copy, damaged);
|
||||
await EmptyAsync(fx, engine, await fx.Service.PlanEmptyTrashAsync(fx.Archive.Id, [replaced.Name], fx.Ct), JobState.Failed);
|
||||
Assert.Contains(replaced.Name, (await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct)).Select(e => e.Name));
|
||||
|
||||
// Whole again, both go; and once the conversion's entry is erased, the originals go with nothing left to check.
|
||||
File.WriteAllBytes(copy, bytes);
|
||||
await EmptyAsync(fx, engine, await fx.Service.PlanEmptyTrashAsync(fx.Archive.Id, null, fx.Ct), JobState.Done);
|
||||
Assert.Empty(await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task OriginalsWhoseConvertedSequenceWasDeletedAreErasedWithIt()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var (id, _) = await UploadedAsync(fx, 2);
|
||||
var engine = await fx.StartEngineAsync();
|
||||
var replaced = await ReplaceAsync(fx, id, [0, 1], 500);
|
||||
await fx.Service.Trash.DeleteAsync(await fx.Service.Trash.PlanAsync([id], null, fx.Ct), null, null, fx.Ct);
|
||||
|
||||
var plan = await fx.Service.PlanEmptyTrashAsync(fx.Archive.Id, null, fx.Ct);
|
||||
Assert.Count(2, plan.Entries);
|
||||
Assert.True(plan.Entries.Single(e => e.Name == replaced.Name).ConversionDeleted);
|
||||
Assert.False(plan.Entries.Single(e => e.Kind == TrashKind.Sequence).ConversionDeleted);
|
||||
// Only the originals: the sequence's entry still holds the conversions, which hash to their records.
|
||||
await EmptyAsync(fx, engine, await fx.Service.PlanEmptyTrashAsync(fx.Archive.Id, [replaced.Name], fx.Ct), JobState.Done);
|
||||
Assert.Equal(TrashKind.Sequence, (await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct)).Single().Kind);
|
||||
|
||||
await fx.Service.RestoreAsync(fx.Archive.Id, (await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct)).Single().Name, fx.Ct);
|
||||
Assert.Count(2, await fx.Db.Frames.ListBySequenceAsync(id));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task AnEntryNamesTheJobThatReplacedItsPhotos()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var (id, photos) = await UploadedAsync(fx, 2);
|
||||
var job = Guid.CreateVersion7();
|
||||
var entry = await ReplaceAsync(fx, id, [0, 1], 500, job);
|
||||
Assert.Equal(job, entry.JobId);
|
||||
Assert.Equal(job, (await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct)).Single().JobId);
|
||||
|
||||
// Its undo swaps the originals back; the entry of the converted files it makes names no job.
|
||||
var undone = await fx.Service.RestoreEntryAsync(fx.Archive.Id, entry.Name, null, fx.Ct);
|
||||
Assert.False(undone.NewSequence);
|
||||
Assert.SequenceEqual(photos.Select(Sha), (await fx.Db.Frames.ListBySequenceAsync(id)).Select(f => f.Sha256!));
|
||||
var swapped = (await fx.Service.ListTrashAsync(fx.Archive.Id, fx.Ct)).Single();
|
||||
Assert.Equal(TrashKind.Replaced, swapped.Kind);
|
||||
Assert.Null(swapped.JobId);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task PositionsOnAConvertedFrameStayWhenAFrameWentBehindTheIndex()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var (id, _) = await UploadedAsync(fx, 3);
|
||||
var frames = await fx.Db.Frames.ListBySequenceAsync(id);
|
||||
var project = new ProjectSettings { ExcludedFrames = [2], HeroFrame = 2 }.ToJson();
|
||||
await fx.Db.Sequences.EditAsync(id, new SequenceEdit { SettingsJson = project, HeroFrameId = frames[2].Id }, null, fx.Ct);
|
||||
// A desktop sharing the archive deletes the first photo; this index has not read the sidecar since.
|
||||
var (other, _) = await fx.OtherWriterAsync();
|
||||
await other.FrameTrash.DeleteAsync(await other.FrameTrash.PlanDeleteAsync(id, [frames[0].Id], null, fx.Ct), null, null, fx.Ct);
|
||||
|
||||
// This host converts the photo the positions are on (second in the sidecar now).
|
||||
await ReplaceAsync(fx, id, [1], 500);
|
||||
|
||||
var row = (await fx.Db.Sequences.GetAsync(id))!;
|
||||
var settings = ProjectSettings.FromJson(row.SettingsJson!);
|
||||
Assert.SequenceEqual([1], settings.ExcludedFrames);
|
||||
Assert.Equal((1, frames[2].Id), (settings.HeroFrame, row.HeroFrameId));
|
||||
Assert.True(settings.PendingFrames is not { Count: > 0 }, "nothing waits for the photo the conversion replaced");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TheOriginalOfAConvertedPhotoFiledAgainIsADuplicateOfItsConversion()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var (id, photos) = await UploadedAsync(fx, 2, "card-1");
|
||||
await ReplaceAsync(fx, id, [0], 500);
|
||||
var sequence = (await fx.Db.Sequences.GetAsync(id))!;
|
||||
var converted = Sidecar(fx, sequence).Frames[0];
|
||||
|
||||
// The card imported again on a PC without its history (same session, so the same sequence).
|
||||
var again = await CommitAsync(fx, null, "card-1", photos[0], "IMG_0001.JPG");
|
||||
Assert.Equal((id, converted.Id, true), (again.SequenceId, again.FrameId, again.Duplicate));
|
||||
var after = Sidecar(fx, sequence);
|
||||
Assert.Count(2, after.Frames);
|
||||
Assert.Contains(after.Removed!, r => r.Sha256 == Sha(photos[0]) && r.Replacement == converted.Sha256 && r.Reason == RemovalReason.Replaced);
|
||||
Assert.True(await fx.Db.FrameRemovals.IsRemovedAsync(id, Sha(photos[0]), fx.Ct), "the alias stays in the index");
|
||||
|
||||
// Converted once more: the original is a duplicate of the last conversion.
|
||||
await ReplaceAsync(fx, id, [0], 600);
|
||||
var last = Sidecar(fx, sequence).Frames[0];
|
||||
var third = await CommitAsync(fx, null, "card-1", photos[0], "IMG_0001.JPG");
|
||||
Assert.Equal((last.Id, true), (third.FrameId, third.Duplicate));
|
||||
Assert.Count(2, Sidecar(fx, sequence).Frames);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task AFolderImportedAgainDoesNotFileTheOriginalsOfItsConvertedPhotos()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var source = Path.Combine(context.CreateTempDirectory("source"), "Etna eruption");
|
||||
Photos.WriteSeries(source, Start, 3);
|
||||
var whole = new ImportOptions { Grouping = ImportGrouping.WholeFolder };
|
||||
var plan = await fx.Service.PlanImportAsync(fx.Archive.Id, source, whole, null, null, fx.Ct);
|
||||
await fx.Service.Imports.ExecuteAsync(new ImportJobParameters(fx.Archive.Id, plan, null, true, null), Guid.NewGuid(), 0, _ => ValueTask.CompletedTask, null,
|
||||
fx.Ct);
|
||||
var id = (await fx.Db.Sequences.FindBySessionKeyAsync(fx.Archive.Id, plan.Sessions.Single().SessionKey))!.Value;
|
||||
await ReplaceAsync(fx, id, [0, 1, 2], 500);
|
||||
var sequence = (await fx.Db.Sequences.GetAsync(id))!;
|
||||
var aliases = Sidecar(fx, sequence).Removed!.Count;
|
||||
|
||||
// A new shot in the folder, imported with the rest of it.
|
||||
Photos.WriteSeries(source, Start.AddMinutes(5), 1, firstSeed: 40, prefix: "LATE_");
|
||||
var later = await fx.Service.PlanImportAsync(fx.Archive.Id, source, whole, null, null, fx.Ct);
|
||||
await fx.Service.Imports.ExecuteAsync(new ImportJobParameters(fx.Archive.Id, later, null, true, null), Guid.NewGuid(), 0, _ => ValueTask.CompletedTask, null,
|
||||
fx.Ct);
|
||||
|
||||
var after = Sidecar(fx, sequence);
|
||||
Assert.Count(4, after.Frames);
|
||||
Assert.Equal(aliases, after.Removed!.Count);
|
||||
Assert.Equal(3, after.Frames.Count(f => f.Source is not null));
|
||||
}
|
||||
}
|
||||
@@ -86,6 +86,28 @@ internal sealed class SyncFixture : IAsyncDisposable
|
||||
null, null), Ct);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replaces the file of the local frame at <paramref name="index"/> with <paramref name="converted"/>, as a conversion's
|
||||
/// Replace does on this PC (owner review 2, R7): the same frame, a tombstone naming the new content.
|
||||
/// </summary>
|
||||
public async Task ReplaceLocalAsync(Guid sequenceId, int index, byte[] converted)
|
||||
{
|
||||
var sequence = (await Db.Sequences.GetAsync(sequenceId, Ct))!;
|
||||
var frame = Chronos.Core.Archiving.ManifestStore.ReadSequence(Archive.Paths.Sequence(sequence.Folder).ManifestPath).Frames[index];
|
||||
var staging = Path.Combine(Archive.Paths.StagingDirectory, "convert-test");
|
||||
Directory.CreateDirectory(staging);
|
||||
var path = Path.Combine(staging, $"{Guid.NewGuid():N}.jpeg");
|
||||
await File.WriteAllBytesAsync(path, converted, Ct);
|
||||
var sha = Convert.ToHexStringLower(System.Security.Cryptography.SHA256.HashData(converted));
|
||||
var swap = new FrameSwap(frame.Id, Archive.Paths.ToRelative(path), [], (current, _) => Path.ChangeExtension(current.File, ".jpeg"), current => current with
|
||||
{
|
||||
Sha256 = sha,
|
||||
Size = converted.Length,
|
||||
Source = new Chronos.Core.Archiving.FrameSource { Sha256 = current.Sha256, Format = current.Format, File = current.File, Size = current.Size },
|
||||
});
|
||||
Assert.NotNull(await Archive.Service.FrameTrash.ReplaceAsync(Archive.Archive, sequenceId, null, [swap], null, null, null, null, Ct));
|
||||
}
|
||||
|
||||
/// <summary>An edit on this PC, as the editor makes it (project file and index, settings version + 1).</summary>
|
||||
public async Task<Sequence> EditLocalSettingsAsync(Guid id, string settingsJson)
|
||||
{
|
||||
|
||||
@@ -84,7 +84,8 @@ public sealed class SyncRulesTests
|
||||
|
||||
// A photo replaced by a converted file on either side is the same photo as its replacement, and so is a chain of them.
|
||||
var replaced = new SyncTombstones([], [new RemovedPhotoDto("aa", "a2", "replaced", at), new RemovedPhotoDto("a2", "a3", "replaced", at)]);
|
||||
Assert.Equal("a3", replaced.Canonical("AA"));
|
||||
Assert.Equal(replaced.Canonical("a3"), replaced.Canonical("AA"));
|
||||
Assert.Equal(replaced.Canonical("a3"), replaced.Canonical("a2"));
|
||||
Assert.Equal((0, 0), SyncRules.CompareOriginals([Photo("aa"), Photo("bb")], [Photo("a3"), Photo("bb")], replaced));
|
||||
Assert.False(replaced.DeletedRemotely("aa"), "a replaced photo is there as its replacement");
|
||||
var replacedHere = new SyncTombstones([new FrameRemoval(localId, "bb", "b2", RemovalReason.Replaced, at)], null);
|
||||
@@ -97,6 +98,43 @@ public sealed class SyncRulesTests
|
||||
new FrameRemoval(localId, "bb", "b2", RemovalReason.Replaced, at)]).Select(r => r.Reason));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void APhotoEachSideConvertedOnItsOwnIsStillOnePhoto()
|
||||
{
|
||||
static FramePhoto Photo(string sha) => new(sha, 100, null);
|
||||
var at = new DateTimeOffset(2026, 10, 27, 10, 0, 0, TimeSpan.Zero);
|
||||
var localId = Guid.CreateVersion7();
|
||||
// This PC converted "oo" to "aa", the server converted its copy to "bb" (another decoder, other bytes).
|
||||
var both = new SyncTombstones([new FrameRemoval(localId, "OO", "aa", RemovalReason.Replaced, at)], [new RemovedPhotoDto("oo", "BB", "replaced", at)]);
|
||||
Assert.Equal(both.Canonical("oo"), both.Canonical("aa"));
|
||||
Assert.Equal(both.Canonical("oo"), both.Canonical("bb"));
|
||||
Assert.Equal((0, 0), SyncRules.CompareOriginals([Photo("aa"), Photo("cc")], [Photo("bb"), Photo("cc")], both));
|
||||
// The same whichever side's links come first, and with an undo (a link back) in the chain.
|
||||
var reversed = new SyncTombstones([new FrameRemoval(localId, "bb", "oo", RemovalReason.Replaced, at)], [new RemovedPhotoDto("aa", "oo", "replaced", at)]);
|
||||
Assert.Equal(both.Canonical("aa"), reversed.Canonical("bb"));
|
||||
Assert.Equal("cc", both.Canonical("CC"));
|
||||
// A deletion covers every encoding of the photo: the server deleted its conversion, so this PC's is not sent.
|
||||
var deleted = new SyncTombstones([new FrameRemoval(localId, "oo", "aa", RemovalReason.Replaced, at)],
|
||||
[new RemovedPhotoDto("oo", "bb", "replaced", at), new RemovedPhotoDto("bb", null, "deleted", at)]);
|
||||
Assert.True(deleted.DeletedRemotely("aa"));
|
||||
Assert.False(deleted.DeletedLocally("bb"));
|
||||
Assert.False(both.DeletedRemotely("aa"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AProxyIsMadeFromThePhotoThisPcConverted()
|
||||
{
|
||||
var heif = new ImageDecoder([new NativeHeif()]);
|
||||
var at = new DateTimeOffset(2026, 10, 27, 10, 0, 0, TimeSpan.Zero);
|
||||
// The server holds the HEIC original "oo" and cannot decode it; this PC converted its copy to a JPEG ("dd").
|
||||
List<Frame> local = [Original("dd", 100, ImageFileFormat.Jpeg)];
|
||||
var manifest = new SequenceManifest(Guid.CreateVersion7(), 1, 1, null, [], [Wanted("oo", 500, "IMG_0001.HEIC")], [], new ProxySpec(1920, 90));
|
||||
var tombstones = new SyncTombstones([new FrameRemoval(Local.Id, "oo", "dd", RemovalReason.Replaced, at)], null);
|
||||
|
||||
Assert.Equal(1, SyncRules.ProxiesToSend(manifest, local, heif, null, tombstones));
|
||||
Assert.Equal(0, SyncRules.ProxiesToSend(manifest, local, heif));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ATombstoneBesideAPhotoItsSideStillHoldsHidesNothing()
|
||||
{
|
||||
|
||||
@@ -793,6 +793,147 @@ public sealed class SyncTransferTests(TestContext context)
|
||||
Assert.Empty(f.Remote.Sequences);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task APhotoEachSideConvertedIsNeitherSentNorFetchedAgain()
|
||||
{
|
||||
await using var f = await SyncFixture.CreateAsync(context);
|
||||
var photos = f.NewPhotos(2);
|
||||
var local = await f.LocalAsync("Comet", photos);
|
||||
// Each side converted its own copy of the first photo, to other bytes (another decoder, another quality).
|
||||
var (mine, theirs) = (f.NewPhotos(1)[0], f.NewPhotos(1)[0]);
|
||||
await f.ReplaceLocalAsync(local.Id, 0, mine);
|
||||
var remote = f.Remote.Add("Comet", [theirs, photos[1]]);
|
||||
remote.Removed.Add(new RemovedPhotoDto(Sha(photos[0]), Sha(theirs), "replaced", DateTimeOffset.UtcNow));
|
||||
await f.Sync.LinkAsync(f.Server, remote.Id, local.Id, f.Ct);
|
||||
await f.RefreshAsync();
|
||||
var entry = await f.EntryAsync("Comet");
|
||||
Assert.Equal((SyncStatus.InSync, 0, 0), (entry.Status, entry.Link!.MissingRemote, entry.Link.MissingLocal));
|
||||
var engine = await f.StartEngineAsync();
|
||||
|
||||
await f.Archive.WaitForAsync((await f.Sync.EnqueueUploadAsync(engine, f.Server, local)).Id, JobState.Done);
|
||||
await f.Archive.WaitForAsync((await f.Sync.EnqueueDownloadAsync(engine, f.Server, remote.Id, "Comet", SyncDownloadMode.Originals, null)).Id,
|
||||
JobState.Done);
|
||||
Assert.SequenceEqual([Sha(theirs), Sha(photos[1])], remote.Frames.Select(r => r.Sha256));
|
||||
Assert.SequenceEqual([Sha(mine), Sha(photos[1])], (await f.Db.Frames.ListBySequenceAsync(local.Id, cancellationToken: f.Ct)).Select(r => r.Sha256!));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task CopiesConvertedOnOneSideBeforeTheyWereLinkedAreLinkedByContent()
|
||||
{
|
||||
await using var f = await SyncFixture.CreateAsync(context);
|
||||
// The Uploader sent the card to the server, which converted it before this PC compared the two.
|
||||
var photos = f.NewPhotos(3);
|
||||
var local = await f.LocalAsync("Comet", photos);
|
||||
var converted = f.NewPhotos(3);
|
||||
var remote = f.Remote.Add("2026-09-28 Canon", converted);
|
||||
foreach (var (original, replacement) in photos.Zip(converted))
|
||||
remote.Removed.Add(new RemovedPhotoDto(Sha(original), Sha(replacement), "replaced", DateTimeOffset.UtcNow));
|
||||
remote.FirstCapture = local.FirstCapture;
|
||||
remote.CameraModel = local.CameraModel;
|
||||
// And the other way round: this PC converted its copy of another card the server holds as it came.
|
||||
var cards = f.NewPhotos(2);
|
||||
var mine = await f.LocalAsync("Harbour", cards);
|
||||
foreach (var (index, replacement) in f.NewPhotos(2).Index()) await f.ReplaceLocalAsync(mine.Id, index, replacement);
|
||||
mine = (await f.Db.Sequences.GetAsync(mine.Id, f.Ct))!;
|
||||
var theirs = f.Remote.Add("2026-09-28 Canon (2)", cards);
|
||||
theirs.FirstCapture = mine.FirstCapture;
|
||||
theirs.CameraModel = mine.CameraModel;
|
||||
|
||||
await f.RefreshAsync();
|
||||
|
||||
var comet = await f.EntryAsync("Comet");
|
||||
Assert.Equal(remote.Id, comet.Link?.RemoteId);
|
||||
Assert.Equal((0, 0), (comet.Link!.MissingRemote, comet.Link.MissingLocal));
|
||||
var harbour = await f.EntryAsync("Harbour");
|
||||
Assert.Equal(theirs.Id, harbour.Link?.RemoteId);
|
||||
Assert.Equal((0, 0), (harbour.Link!.MissingRemote, harbour.Link.MissingLocal));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task AFrameMissingHereTakesBackItsPhotoAsTheServerConvertedIt()
|
||||
{
|
||||
await using var f = await SyncFixture.CreateAsync(context);
|
||||
var photos = f.NewPhotos(3);
|
||||
var local = await f.LocalAsync("Harbour", photos);
|
||||
var lost = (await f.Db.Frames.ListBySequenceAsync(local.Id, cancellationToken: f.Ct))[1];
|
||||
File.Delete(f.Archive.Paths.FromRelative(lost.RelativePath));
|
||||
await f.Archive.Service.Verifier.VerifyAsync(f.Archive.Archive, [local.Id], default, (_, _, _) => ValueTask.CompletedTask, cancellationToken: f.Ct);
|
||||
// The server converted that photo.
|
||||
var converted = f.NewPhotos(1)[0];
|
||||
var remote = f.Remote.Add("Harbour", [photos[0], converted, photos[2]]);
|
||||
remote.Removed.Add(new RemovedPhotoDto(Sha(photos[1]), Sha(converted), "replaced", DateTimeOffset.UtcNow));
|
||||
await f.Sync.LinkAsync(f.Server, remote.Id, local.Id, f.Ct);
|
||||
await f.RefreshAsync();
|
||||
var behind = await f.EntryAsync("Harbour");
|
||||
Assert.Equal((SyncStatus.ServerAhead, 1), (behind.Status, behind.Link!.MissingLocal));
|
||||
var engine = await f.StartEngineAsync();
|
||||
|
||||
var job = await f.Sync.EnqueueDownloadAsync(engine, f.Server, remote.Id, "Harbour", SyncDownloadMode.Originals, null);
|
||||
await f.Archive.WaitForAsync(job.Id, JobState.Done);
|
||||
|
||||
// The same frame, holding the server's conversion, and no frame beside it.
|
||||
var frames = await f.Db.Frames.ListBySequenceAsync(local.Id, cancellationToken: f.Ct);
|
||||
Assert.Equal(3, frames.Count);
|
||||
Assert.Equal((lost.Id, Sha(converted)), (frames[1].Id, frames[1].Sha256));
|
||||
Assert.True(frames.All(fr => (fr.Flags & FrameFlags.Missing) == 0), "the frame is no longer missing");
|
||||
Assert.Equal(Sha(converted), Sha(await File.ReadAllBytesAsync(f.Archive.Paths.FromRelative(frames[1].RelativePath), f.Ct)));
|
||||
Assert.True(await f.Db.FrameRemovals.IsRemovedAsync(local.Id, Sha(photos[1]), f.Ct), "the original is an alias of its conversion here too");
|
||||
Assert.Equal(SyncStatus.InSync, (await f.EntryAsync("Harbour")).Status);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task AConversionMissingHereTakesBackTheOriginalTheServerHolds()
|
||||
{
|
||||
await using var f = await SyncFixture.CreateAsync(context);
|
||||
var photos = f.NewPhotos(3);
|
||||
var local = await f.LocalAsync("Harbour", photos);
|
||||
var remote = f.Remote.Add("Harbour", photos);
|
||||
await f.Sync.LinkAsync(f.Server, remote.Id, local.Id, f.Ct);
|
||||
// This PC converted the second photo, and that file is gone since.
|
||||
var converted = f.NewPhotos(1)[0];
|
||||
await f.ReplaceLocalAsync(local.Id, 1, converted);
|
||||
var lost = (await f.Db.Frames.ListBySequenceAsync(local.Id, cancellationToken: f.Ct))[1];
|
||||
File.Delete(f.Archive.Paths.FromRelative(lost.RelativePath));
|
||||
await f.Archive.Service.Verifier.VerifyAsync(f.Archive.Archive, [local.Id], default, (_, _, _) => ValueTask.CompletedTask, cancellationToken: f.Ct);
|
||||
await f.RefreshAsync();
|
||||
Assert.Equal(1, (await f.EntryAsync("Harbour")).Link!.MissingLocal);
|
||||
var engine = await f.StartEngineAsync();
|
||||
|
||||
var job = await f.Sync.EnqueueDownloadAsync(engine, f.Server, remote.Id, "Harbour", SyncDownloadMode.Originals, null);
|
||||
await f.Archive.WaitForAsync(job.Id, JobState.Done);
|
||||
|
||||
var frames = await f.Db.Frames.ListBySequenceAsync(local.Id, cancellationToken: f.Ct);
|
||||
Assert.Equal(3, frames.Count);
|
||||
Assert.Equal((lost.Id, Sha(photos[1])), (frames[1].Id, frames[1].Sha256));
|
||||
Assert.True(await f.Db.FrameRemovals.IsRemovedAsync(local.Id, Sha(converted), f.Ct), "the conversion is an alias of the original");
|
||||
Assert.False(await f.Db.FrameRemovals.IsRemovedAsync(local.Id, Sha(photos[1]), f.Ct));
|
||||
Assert.Equal(SyncStatus.InSync, (await f.EntryAsync("Harbour")).Status);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task AnUploadSendsTheProxyOfAPhotoThisPcConverted()
|
||||
{
|
||||
await using var f = await SyncFixture.CreateAsync(context);
|
||||
var photos = f.NewPhotos(3);
|
||||
var local = await f.LocalAsync("Holy grail", photos);
|
||||
// The server holds the originals and cannot decode them (HEIF, BRIEF §2.3); this PC converted its copy of the first.
|
||||
var remote = f.Remote.Add("Holy grail", photos);
|
||||
remote.Undecodable = true;
|
||||
await f.ReplaceLocalAsync(local.Id, 0, f.NewPhotos(1)[0]);
|
||||
await f.Sync.LinkAsync(f.Server, remote.Id, local.Id, f.Ct);
|
||||
await f.RefreshAsync();
|
||||
var ahead = await f.EntryAsync("Holy grail");
|
||||
Assert.Equal((SyncStatus.LocalAhead, 3), (ahead.Status, ahead.Link!.MissingRemote));
|
||||
var engine = await f.StartEngineAsync();
|
||||
|
||||
var job = await f.Sync.EnqueueUploadAsync(engine, f.Server, local);
|
||||
var done = await f.Archive.WaitForAsync(job.Id, JobState.Done);
|
||||
|
||||
Assert.True(f.Remote.SentProxies.Keys.ToHashSet().SetEquals(remote.Frames.Select(r => r.Id)), "a proxy of every frame");
|
||||
Assert.Equal(3, remote.Frames.Count);
|
||||
Assert.Contains(Loc.L("Archive.Log.ProxiesSent", 3, 0), done.LogTail);
|
||||
}
|
||||
|
||||
private static async Task<Render> AddRenderAsync(SyncFixture f, Sequence local, string name, long bytes)
|
||||
{
|
||||
var render = new Render
|
||||
|
||||
Reference in new issue
Block a user