fix(reorganize): a sequence still receiving photos keeps its file names and the job goes on
A Reorganize with a file template failed its job at the step of a sequence
a camera was still uploading into, and its retry gave the rest up. Photos
changed since the plan now never refuse a step: that sequence keeps its file
names (FilesKept), its folder and title change as planned, the other steps go
on and the job ends with ReorganizeKept. The fingerprint, the job's
confirmation and the check under the leases pin file renames by their digest
instead of the frames version, so photos filed under the names the plan gives
them no longer make a dry run or a queued job stale.
- A step whose folder or files a template names after {title} checks the
title as a retitle does (RenameStep.NamedByTitle): no name comes from a
title edited since the plan.
- Recovery sends a photo that already took its new name back together with a
companion whose new name was taken, so the two never end up apart.
- ArchiveService.OpenAsync logs a NewerFormatException from resuming a plan
and keeps its journal, so a server still boots.
- Once a step's folder moved, every index row of the step follows it even
when a sidecar cannot be read or written; the step then fails for a retry.
- Job log lines and errors give the real reason for files kept busy (in use
or a new name taken) and for a sidecar of a newer format (new Newer
outcome; strings en and it).
- A plan an archive open completes tells sequenceChanged; the docs that
promised more than that are corrected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit f8554b8af0828ab9b0ff128e694abacdd53e6fd7)
This commit is contained in:
1 parent
59ee982e4d
commit
9e1f109b58
16 files changed
+560
-195
No files matched your search
@@ -252,29 +252,52 @@ public sealed class ReorganizeTests(TestContext context)
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task APlanWhosePhotosChangedIsRefusedOrResumedWithoutTheirNames()
|
||||
public async Task APlanWhosePhotosChangedAppliesWithoutTheirNames()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var id = await UploadAsync(fx, 2);
|
||||
var plan = await fx.Service.PlanReorganizeAsync(fx.Archive.Id, [id], new RenameTemplates(File: "{n:000}", Title: "Roof"), fx.Ct);
|
||||
// A photo arrives after the dry run: the names shown are no longer the ones the template gives.
|
||||
// A photo arrives after the dry run, filed between them: the names shown are no longer the ones the template gives.
|
||||
await UploadAsync(fx, 1, firstSeed: 9, firstSecond: 5);
|
||||
var before = await FilesAsync(fx, id);
|
||||
|
||||
var stale = await Assert.ThrowsAsync<StaleRenamePlanException>(() => fx.Service.ApplyRenameAsync(plan, null, fx.Ct));
|
||||
Assert.Equal(id, stale.SequenceId);
|
||||
Assert.SequenceEqual(before, await FilesAsync(fx, id));
|
||||
Assert.Null((await fx.Db.Sequences.GetAsync(id))!.Title);
|
||||
Assert.Empty(RenameJournal.ListPending(fx.Paths));
|
||||
|
||||
// Interrupted before its step began, the plan resumes: the title changes, the files keep their names.
|
||||
RenameJournal.Write(fx.Paths, new RenameJournal(plan, []));
|
||||
Assert.Equal(1, await fx.Service.Renamer.ResumePendingAsync(fx.Archive, fx.Ct));
|
||||
// The title changes, the files keep their names.
|
||||
var result = await fx.Service.ApplyRenameAsync(plan, null, fx.Ct);
|
||||
Assert.SequenceEqual([id], result.FilesKept);
|
||||
Assert.SequenceEqual([id], result.Changed);
|
||||
Assert.Equal(0, result.Files);
|
||||
Assert.SequenceEqual(before, await FilesAsync(fx, id));
|
||||
Assert.Equal("Roof", (await fx.Db.Sequences.GetAsync(id))!.Title);
|
||||
Assert.Empty(RenameJournal.ListPending(fx.Paths));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task PhotosReceivedUnderTheNamesThePlanGivesLeaveItAsItWas()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var id = await UploadAsync(fx, 2);
|
||||
// The archive files new photos as the Reorganize names them, which its photos do not follow yet.
|
||||
const string Template = "{n:000}";
|
||||
await fx.Service.UpdateSettingsAsync(fx.Archive.Id, s => s with { Templates = s.Templates with { File = Template } }, fx.Ct);
|
||||
var templates = new RenameTemplates(File: Template);
|
||||
var plan = await fx.Service.PlanReorganizeAsync(fx.Archive.Id, [id], templates, fx.Ct);
|
||||
Assert.Equal(2, plan.Steps.Single().FileChanges);
|
||||
var request = ArchiveJobs.Reorganize(fx.Archive, plan, templates);
|
||||
|
||||
// A camera still uploads into it: its photo is filed under the name the plan leaves it, which changes nothing of the plan.
|
||||
await UploadAsync(fx, 1, firstSeed: 3, firstSecond: 20);
|
||||
Assert.Equal("originals/003.JPG", (await FilesAsync(fx, id))[2]);
|
||||
var now = await fx.Service.PlanReorganizeAsync(fx.Archive.Id, [id], templates, fx.Ct);
|
||||
Assert.NotEqual(plan.Steps.Single().FramesVersion, now.Steps.Single().FramesVersion);
|
||||
Assert.Equal(plan.Fingerprint(), now.Fingerprint());
|
||||
|
||||
// The job confirmed before it applies it as it was shown.
|
||||
var engine = await fx.StartEngineAsync();
|
||||
var done = await fx.WaitForAsync((await engine.EnqueueAsync(request, cancellationToken: fx.Ct)).Id, JobState.Done);
|
||||
Assert.Contains(Loc.L("Archive.Log.Reorganized", 1, 2), done.LogTail);
|
||||
Assert.SequenceEqual(["originals/001.JPG", "originals/002.JPG", "originals/003.JPG"], await FilesAsync(fx, id));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task CompanionsMoveWithTheirPhoto()
|
||||
{
|
||||
@@ -403,26 +426,72 @@ public sealed class ReorganizeTests(TestContext context)
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task AStepWhosePhotosChangedIsRefusedUnderItsLeasesBeforeAnythingMoves()
|
||||
public async Task AStepWhosePhotosChangedUnderItsLeasesMovesWithoutRenamingThem()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var (parent, nested, plan) = await CarrierAsync(fx);
|
||||
var from = await FolderAsync(fx, parent);
|
||||
|
||||
// A photo uploaded once the plan's own checks passed, before its step: nothing of that step moves.
|
||||
var stale = await Assert.ThrowsAsync<StaleRenamePlanException>(() => fx.Service.Renamer.ApplyAsync(fx.Archive, plan,
|
||||
async _ => await UploadAsync(fx, 1, firstSeed: 9, firstSecond: 5), null, fx.Ct));
|
||||
Assert.Equal(parent, stale.SequenceId);
|
||||
var before = await FilesAsync(fx, parent);
|
||||
Assert.Equal((from, from + "/extra"), (await FolderAsync(fx, parent), await FolderAsync(fx, nested)));
|
||||
Assert.Empty(Assert.NotNull(RenameJournal.Read(fx.Paths, plan.Id)).Completed);
|
||||
|
||||
// Resumed after an interruption, the folder moves with the one inside it, whose index row follows, and the files keep their names.
|
||||
var result = Assert.NotNull(await fx.Service.Renamer.ResumeAsync(fx.Archive, plan.Id, null, fx.Ct));
|
||||
// A photo uploaded once the plan's own checks passed, before its step: the folder moves with the one inside it,
|
||||
// whose index row follows, and the files keep their names.
|
||||
var result = await fx.Service.Renamer.ApplyAsync(fx.Archive, plan, async _ => await UploadAsync(fx, 1, firstSeed: 9, firstSecond: 5), null, fx.Ct);
|
||||
Assert.SequenceEqual([parent], result.FilesKept);
|
||||
Assert.SequenceEqual([parent, nested], result.Changed);
|
||||
Assert.Equal(("moved/2026-09-28", "moved/2026-09-28/extra"), (await FolderAsync(fx, parent), await FolderAsync(fx, nested)));
|
||||
Assert.SequenceEqual(before, await FilesAsync(fx, parent));
|
||||
var files = await FilesAsync(fx, parent);
|
||||
Assert.Count(3, files);
|
||||
Assert.Empty(files.Intersect(plan.Steps[0].FileSamples.Select(s => s.To)));
|
||||
Assert.Empty(RenameJournal.ListPending(fx.Paths));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task ASequenceStillReceivingPhotosKeepsItsFileNamesWhileTheJobGoesOn()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var first = await UploadAsync(fx, 2);
|
||||
var second = await UploadAsync(fx, 2, firstSeed: 20, firstSecond: 3600, key: "upload-2");
|
||||
var third = await UploadAsync(fx, 2, firstSeed: 40, firstSecond: 7200, key: "upload-3");
|
||||
var templates = new RenameTemplates(Folder: "moved/{date} {hm}", File: "{n:000}");
|
||||
var plan = await fx.Service.PlanReorganizeAsync(fx.Archive.Id, [first, second, third], templates, fx.Ct);
|
||||
var told = new ConcurrentQueue<Guid>();
|
||||
var service = new ArchiveService(fx.Db, new ArchiveServiceOptions
|
||||
{
|
||||
Owner = "jobs",
|
||||
LeaseWait = TimeSpan.FromSeconds(TestTiming.Budget(20)),
|
||||
SequenceChanged = (id, _, _) =>
|
||||
{
|
||||
told.Enqueue(id);
|
||||
return Task.CompletedTask;
|
||||
},
|
||||
});
|
||||
await using var engine = new JobEngine(fx.Db, service.CreateJobHandlers(),
|
||||
new JobEngineOptions { Workers = 1, WorkerId = "test", PollInterval = TimeSpan.FromMilliseconds(50), CheckpointInterval = TimeSpan.FromMilliseconds(50) });
|
||||
await engine.StartAsync(fx.Ct);
|
||||
|
||||
// A camera uploads into the second sequence while the job waits for the first.
|
||||
Job job;
|
||||
using (await LeaseFile.AcquireAsync(fx.Paths.LocksDirectory, $"seq-{first:N}", "editor", TimeSpan.FromSeconds(5), cancellationToken: fx.Ct))
|
||||
{
|
||||
job = await engine.EnqueueAsync(ArchiveJobs.Reorganize(fx.Archive, plan, templates), cancellationToken: fx.Ct);
|
||||
var until = DateTime.UtcNow.AddSeconds(TestTiming.Budget(15));
|
||||
while (RenameJournal.ListPending(fx.Paths).Count == 0)
|
||||
{
|
||||
Assert.True(DateTime.UtcNow < until, "the job never started its plan");
|
||||
await Task.Delay(20, fx.Ct);
|
||||
}
|
||||
await UploadAsync(fx, 1, firstSeed: 30, firstSecond: 3605, key: "upload-2");
|
||||
}
|
||||
var received = await FilesAsync(fx, second);
|
||||
|
||||
// Its folder moves and its files keep their names; the sequence after it is reorganized; the job then says why it failed.
|
||||
var failed = await fx.WaitForAsync(job.Id, JobState.Failed, (int)TestTiming.Budget(60));
|
||||
Assert.Equal(Loc.Plural("Archive.Error.ReorganizeKept", 1), failed.Error);
|
||||
Assert.Contains(Loc.L("Archive.Log.Reorganized", 3, 4), failed.LogTail);
|
||||
Assert.Contains(Loc.L("Archive.Log.ReorganizeFilesKept", plan.Steps.Single(s => s.SequenceId == second).FromFolder), failed.LogTail);
|
||||
Assert.Equal(("moved/2026-09-28 18-00", "moved/2026-09-28 19-00", "moved/2026-09-28 20-00"),
|
||||
(await FolderAsync(fx, first), await FolderAsync(fx, second), await FolderAsync(fx, third)));
|
||||
Assert.SequenceEqual(received, await FilesAsync(fx, second));
|
||||
foreach (var id in new[] { first, third }) Assert.SequenceEqual(["originals/001.JPG", "originals/002.JPG"], await FilesAsync(fx, id));
|
||||
Assert.SequenceEqual([first, second, third], told);
|
||||
Assert.Empty(RenameJournal.ListPending(fx.Paths));
|
||||
}
|
||||
|
||||
@@ -452,7 +521,7 @@ public sealed class ReorganizeTests(TestContext context)
|
||||
await using var fx = await CreateAsync(context);
|
||||
var first = await UploadAsync(fx, 2);
|
||||
var second = await UploadAsync(fx, 2, firstSeed: 20, firstSecond: 3600, key: "upload-2");
|
||||
var templates = new RenameTemplates(File: "{n:000}");
|
||||
var templates = new RenameTemplates(File: "{n:000}", Title: "Roof");
|
||||
var plan = await fx.Service.PlanReorganizeAsync(fx.Archive.Id, [first, second], templates, fx.Ct);
|
||||
var told = new ConcurrentQueue<(Guid, string)>();
|
||||
var service = new ArchiveService(fx.Db, new ArchiveServiceOptions
|
||||
@@ -469,7 +538,7 @@ public sealed class ReorganizeTests(TestContext context)
|
||||
new JobEngineOptions { Workers = 1, WorkerId = "test", PollInterval = TimeSpan.FromMilliseconds(50), CheckpointInterval = TimeSpan.FromMilliseconds(50) });
|
||||
await engine.StartAsync(fx.Ct);
|
||||
|
||||
// An editor holds the first sequence while the job starts its plan (planned again: its own id); a photo reaches the second meanwhile.
|
||||
// An editor holds the first sequence while the job starts its plan (planned again: its own id); the second is retitled meanwhile.
|
||||
Job job;
|
||||
using (await LeaseFile.AcquireAsync(fx.Paths.LocksDirectory, $"seq-{first:N}", "editor", TimeSpan.FromSeconds(5), cancellationToken: fx.Ct))
|
||||
{
|
||||
@@ -480,7 +549,7 @@ public sealed class ReorganizeTests(TestContext context)
|
||||
Assert.True(DateTime.UtcNow < until, "the job never started its plan");
|
||||
await Task.Delay(20, fx.Ct);
|
||||
}
|
||||
await UploadAsync(fx, 1, firstSeed: 30, firstSecond: 3605, key: "upload-2");
|
||||
await fx.Service.SetSequenceInfoAsync(second, "Roof north", [], 0, null, fx.Ct);
|
||||
}
|
||||
|
||||
var failed = await fx.WaitForAsync(job.Id, JobState.Failed, (int)TestTiming.Budget(60));
|
||||
@@ -492,7 +561,7 @@ public sealed class ReorganizeTests(TestContext context)
|
||||
Assert.SequenceEqual([first], journal.Completed);
|
||||
Assert.SequenceEqual(["originals/001.JPG", "originals/002.JPG"], await FilesAsync(fx, first));
|
||||
var untouched = await FilesAsync(fx, second);
|
||||
Assert.Count(3, untouched);
|
||||
Assert.Equal("Roof north", (await fx.Db.Sequences.GetAsync(second))!.Title);
|
||||
|
||||
// An archive open leaves it alone; the retry checks the rest as a plan applied anew and gives it up.
|
||||
Assert.Equal(0, await fx.Service.Renamer.ResumePendingAsync(fx.Archive, fx.Ct));
|
||||
@@ -617,8 +686,12 @@ public sealed class ReorganizeTests(TestContext context)
|
||||
Assert.SequenceEqual(before, await FilesAsync(fx, id));
|
||||
Assert.Null(FileRenameJournal.Read(folder));
|
||||
|
||||
// Interrupted there, the plan resumes at the next open without its files; a new dry run renames none of them.
|
||||
await fx.Service.OpenAsync(fx.Archive.RootPath, fx.Ct);
|
||||
// Interrupted there, its job resumes the plan without its files and says why; a new dry run renames none of them.
|
||||
var engine = await fx.StartEngineAsync();
|
||||
var failed = await fx.WaitForAsync((await fx.EnqueueWithCheckpointAsync(engine, ArchiveJobs.Reorganize(fx.Archive, plan, templates),
|
||||
"plan:" + plan.Id.ToString("N"))).Id, JobState.Failed);
|
||||
Assert.Equal(Loc.Plural("Archive.Error.ReorganizeNewer", 1), failed.Error);
|
||||
Assert.Contains(Loc.L("Archive.Log.ReorganizeNewerKept", plan.Steps.Single().FromFolder), failed.LogTail);
|
||||
Assert.Empty(RenameJournal.ListPending(fx.Paths));
|
||||
Assert.SequenceEqual(before, await FilesAsync(fx, id));
|
||||
var again = (await fx.Service.PlanReorganizeAsync(fx.Archive.Id, [id], templates, fx.Ct)).Steps.Single();
|
||||
@@ -669,16 +742,114 @@ public sealed class ReorganizeTests(TestContext context)
|
||||
var plan = await fx.Service.PlanReorganizeAsync(fx.Archive.Id, [id], new RenameTemplates(File: "{n:000}"), fx.Ct);
|
||||
Assert.Equal((2, RenameBlock.Unhashed), (plan.Steps.Single().FileChanges, plan.Steps.Single().Blocked.Single().Reason));
|
||||
|
||||
// A verify hashes it afterwards, which leaves the frames version as it is: the plan would now rename it too.
|
||||
// A verify hashes it afterwards, which leaves the frames version as it is: the plan would now rename it too, so none is.
|
||||
ManifestStore.WriteSequence(folder.ManifestPath, manifest);
|
||||
var before = await FilesAsync(fx, id);
|
||||
await Assert.ThrowsAsync<StaleRenamePlanException>(() => fx.Service.ApplyRenameAsync(plan, null, fx.Ct));
|
||||
var result = await fx.Service.ApplyRenameAsync(plan, null, fx.Ct);
|
||||
Assert.SequenceEqual([id], result.FilesKept);
|
||||
Assert.Empty(result.Changed);
|
||||
Assert.SequenceEqual(before, await FilesAsync(fx, id));
|
||||
|
||||
// Interrupted before its step, it resumes without renaming any of them.
|
||||
// So it is when resumed after an interruption before its step.
|
||||
RenameJournal.Write(fx.Paths, new RenameJournal(plan, []));
|
||||
var result = Assert.NotNull(await fx.Service.Renamer.ResumeAsync(fx.Archive, plan.Id, null, fx.Ct));
|
||||
result = Assert.NotNull(await fx.Service.Renamer.ResumeAsync(fx.Archive, plan.Id, null, fx.Ct));
|
||||
Assert.SequenceEqual([id], result.FilesKept);
|
||||
Assert.SequenceEqual(before, await FilesAsync(fx, id));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task NamesComeFromATitleEditedAfterThePlanNever()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var id = await UploadAsync(fx, 2);
|
||||
await fx.Service.SetSequenceInfoAsync(id, "Roof", [], 0, null, fx.Ct);
|
||||
var from = await FolderAsync(fx, id);
|
||||
// The folder and the files are named after the title, which the plan does not change.
|
||||
var plan = await fx.Service.PlanReorganizeAsync(fx.Archive.Id, [id], new RenameTemplates(Folder: "moved/{title}", File: "{title}_{n:000}"), fx.Ct);
|
||||
Assert.True(plan.Steps.Single() is { ToFolder: "moved/Roof", FileChanges: 2, Retitles: false, NamedByTitle: true });
|
||||
var before = await FilesAsync(fx, id);
|
||||
|
||||
// Retitled once the plan's own checks passed: refused before anything of it moves.
|
||||
await Assert.ThrowsAsync<StaleRenamePlanException>(() => fx.Service.Renamer.ApplyAsync(fx.Archive, plan,
|
||||
async _ => await fx.Service.SetSequenceInfoAsync(id, "Roof north", [], 0, null, fx.Ct), null, fx.Ct));
|
||||
Assert.Equal(from, await FolderAsync(fx, id));
|
||||
Assert.SequenceEqual(before, await FilesAsync(fx, id));
|
||||
|
||||
// Held by its job, the rest is refused as a plan applied anew; interrupted, it is dropped.
|
||||
Assert.True(MassRenamer.Hold(fx.Archive, plan.Id));
|
||||
await Assert.ThrowsAsync<StaleRenamePlanException>(() => fx.Service.Renamer.ResumeAsync(fx.Archive, plan.Id, null, fx.Ct));
|
||||
RenameJournal.Write(fx.Paths, new RenameJournal(plan, []));
|
||||
var result = Assert.NotNull(await fx.Service.Renamer.ResumeAsync(fx.Archive, plan.Id, null, fx.Ct));
|
||||
Assert.SequenceEqual([id], result.Dropped);
|
||||
Assert.Equal(from, await FolderAsync(fx, id));
|
||||
Assert.SequenceEqual(before, await FilesAsync(fx, id));
|
||||
Assert.Equal("Roof north", (await fx.Db.Sequences.GetAsync(id))!.Title);
|
||||
Assert.Empty(RenameJournal.ListPending(fx.Paths));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task APlanAnArchiveOpenCompletesTellsTheSequencesItChanged()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var id = await UploadAsync(fx, 1);
|
||||
var plan = await fx.Service.PlanReorganizeAsync(fx.Archive.Id, [id], new RenameTemplates(Folder: "moved/{date}"), fx.Ct);
|
||||
// Its job yielded to another, or its host stopped, before the step: the plan is not held.
|
||||
RenameJournal.Write(fx.Paths, new RenameJournal(plan, []));
|
||||
var told = new ConcurrentQueue<(Guid, string)>();
|
||||
var service = new ArchiveService(fx.Db, new ArchiveServiceOptions
|
||||
{
|
||||
Owner = "test",
|
||||
SequenceChanged = (sequence, change, _) =>
|
||||
{
|
||||
told.Enqueue((sequence, change));
|
||||
return Task.CompletedTask;
|
||||
},
|
||||
});
|
||||
|
||||
await service.OpenAsync(fx.Archive.RootPath, fx.Ct);
|
||||
Assert.SequenceEqual([(id, MassRenamer.Change)], told);
|
||||
Assert.Equal("moved/2026-09-28", await FolderAsync(fx, id));
|
||||
Assert.Empty(RenameJournal.ListPending(fx.Paths));
|
||||
}
|
||||
|
||||
[Test]
|
||||
[WindowsOnly]
|
||||
public async Task AMovedFolderWhoseSidecarCannotBeWrittenHasEveryIndexRowFollowIt()
|
||||
{
|
||||
await using var fx = await CreateAsync(context);
|
||||
var parent = await UploadAsync(fx, 2);
|
||||
var folder = (await fx.Db.Sequences.GetAsync(parent))!.Folder;
|
||||
Photos.WriteSeries(Path.Combine(fx.Paths.FromRelative(folder), "extra"), Start.AddDays(3), 2, firstSeed: 50);
|
||||
await fx.ScanAsync();
|
||||
var nested = (await fx.Db.Sequences.ListLocationsAsync(fx.Archive.Id)).Single(l => l.Folder == folder + "/extra").Id;
|
||||
var plan = await fx.Service.PlanReorganizeAsync(fx.Archive.Id, [parent], new RenameTemplates(Folder: "moved/{date}", Title: "Roof"), fx.Ct);
|
||||
Assert.SequenceEqual([(parent, false), (nested, true)], plan.Steps.Select(s => (s.SequenceId, s.Carried)));
|
||||
string[] sidecars = [fx.Paths.Sequence(folder).ManifestPath, fx.Paths.Sequence("moved/2026-09-28").ManifestPath];
|
||||
void Writable(bool writable)
|
||||
{
|
||||
foreach (var sidecar in sidecars.Where(File.Exists))
|
||||
File.SetAttributes(sidecar, writable ? File.GetAttributes(sidecar) & ~FileAttributes.ReadOnly : File.GetAttributes(sidecar) | FileAttributes.ReadOnly);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// Its sidecar can be read, not written: the new title fails once the folder moved.
|
||||
Writable(false);
|
||||
await Assert.ThrowsAsync<UnauthorizedAccessException>(() => fx.Service.ApplyRenameAsync(plan, null, fx.Ct));
|
||||
// Both index rows followed the folder all the same; the title waits for the rest of the step.
|
||||
Assert.Equal(("moved/2026-09-28", "moved/2026-09-28/extra"), (await FolderAsync(fx, parent), await FolderAsync(fx, nested)));
|
||||
Assert.Null((await fx.Db.Sequences.GetAsync(parent))!.Title);
|
||||
Assert.Empty(Assert.NotNull(RenameJournal.Read(fx.Paths, plan.Id)).Completed);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Writable(true);
|
||||
}
|
||||
|
||||
var result = Assert.NotNull(await fx.Service.Renamer.ResumeAsync(fx.Archive, plan.Id, null, fx.Ct));
|
||||
Assert.SequenceEqual([parent, nested], result.Changed);
|
||||
Assert.Equal("Roof", (await fx.Db.Sequences.GetAsync(parent))!.Title);
|
||||
await FilesAsync(fx, parent);
|
||||
Assert.Empty(RenameJournal.ListPending(fx.Paths));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user