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:
Alby96 committed 2026-10-27 18:08:07 +01:00
1 parent 59ee982e4d
commit 9e1f109b58
16 files changed
+560 -195

No files matched your search

@@ -42,14 +42,14 @@ public sealed record EmptyTrashItem(string Name, string Fingerprint);
/// <summary>
/// <see cref="JobKind.Move"/> (Reorganize, owner review 2, R7): target = the archive; the templates (null keeps that part),
/// the sequences the confirmed plan changes in the order it was made for, each with the frames version its file names
/// were planned at (0 when none is renamed), and the plan's fingerprint (<see cref="Core.Archiving.RenamePlan.Fingerprint"/>).
/// No file list: the job plans again and refuses when the plan is no longer the one confirmed.
/// the sequences the confirmed plan changes in the order it was made for, and the plan's fingerprint
/// (<see cref="Core.Archiving.RenamePlan.Fingerprint"/>, which pins every file rename by its digest). No file list: the job
/// plans again and refuses when the plan is no longer the one confirmed.
/// </summary>
public sealed record MoveJobParameters(string? FolderTemplate, string? FileTemplate, string? TitleTemplate, IReadOnlyList<MoveSequence> Sequences, string Fingerprint);
/// <summary>A sequence of a <see cref="MoveJobParameters"/> and the frames version its file names were planned at.</summary>
public sealed record MoveSequence(Guid Id, int FramesVersion);
/// <summary>A sequence of a <see cref="MoveJobParameters"/> (a job queued by an earlier build also names a frames version, which is ignored).</summary>
public sealed record MoveSequence(Guid Id);
/// <summary>A job ready to enqueue.</summary>
public sealed record ArchiveJobRequest(JobKind Kind, IReadOnlyList<Guid> Targets, string? Label, string? ParametersJson, JobPriority Priority);