fix(reorganize): never name a folder or title after a photo no longer first, and retry a kept job honestly
A Reorganize step whose photos changed after the plan kept its file names but still moved its folder and wrote the title the plan had computed from the old first photo, so a trashed first photo or an earlier photo filed since left the sequence named after a photo that is no longer first. The plan now journals its folder and title templates, and under the step's leases each folder move or retitle is expanded again from the settled sidecar: it is applied only when it gives what the plan gives (the folder itself or its " (n)"); otherwise the sequence stays as it was (Dropped, "changed after the plan"), or keeps its title and file names when an interrupted run moved its folder already (TitlesKept). Plans journaled before this change are applied as made. A Move job that ended failed with sequences kept, or whose held plan was given up, kept its plan:<id> checkpoint after the plan's journal was gone, so a retry logged "completed when the archive was opened" and ended done. Such a job now saves the checkpoint "applied": a retry plans again and applies only a plan that is still the one confirmed. A job that succeeds keeps plan:<id>, so a crash before it is marked done still finds the plan completed. Sequences a folder was to carry when that folder stayed (dropped, its title edited, its names no longer given, or a newer sidecar) were reported as "changed after the plan", and a newer-format carrier failed the job with ReorganizeKept. They are now a separate outcome, CarriedKept (journaled), logged with the new Archive.Log.ReorganizeCarriedKept (en+it) and not counted in the job's error, which follows the carrier's own reason. When a step's sidecar cannot be read or written after its folder moved, every sequence of the step is told (sequenceChanged "reorganized") before the failure is thrown, since the retry that would tell them may never come. Tests: Core APlanKeepsItsTemplatesSoTheNamesOfAFirstPhotoNoLongerFirstAreTold; Data AFolderOrTitleNamedAfterAPhotoNoLongerFirstIsNeverGiven, ARetryOfAJobThatKeptSequencesPlansAgain, ASequenceAFolderWasToCarryIsToldItStayedWithIt, AnArchiveOpensWhenAnInterruptedRenameMeetsASidecarOfANewerFormat, AResumedStepWhoseFolderMovedKeepsATitleEditedSinceAndTheNamesFromIt, and AMovedFolderWhoseSidecarCannotBeReadThereHasItsIndexRowFollowAndIsTold, which breaks the sidecar with a relative symbolic link instead of a read-only file, so it also runs on the Linux runner as root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 130701afab224d47ea066eb7cc8debb16d1fb432)
This commit is contained in:
1 parent
37800b28ef
commit
8127373fd5
9 files changed
+455
-77
No files matched your search
@@ -153,6 +153,7 @@
|
||||
<data name="Archive.Log.Orphans" xml:space="preserve"><value>Foto non indicizzate: {0}, foto mancanti: {1}</value></data>
|
||||
<data name="Archive.Log.ProxiesDone" xml:space="preserve"><value>{0}: create {1}, riusate {2}, illeggibili {3}, in attesa {4}</value></data>
|
||||
<data name="Archive.Log.ProxiesSent" xml:space="preserve"><value>Proxy per il server: {0} inviati, {1} non inviati</value></data>
|
||||
<data name="Archive.Log.ReorganizeCarriedKept" xml:space="preserve"><value>Lasciata com'era, la cartella che la contiene è rimasta: {0}</value></data>
|
||||
<data name="Archive.Log.ReorganizeDropped" xml:space="preserve"><value>Lasciata com'era, cambiata dopo il piano: {0}</value></data>
|
||||
<data name="Archive.Log.ReorganizeFilesBusy" xml:space="preserve"><value>Nomi dei file mantenuti, una foto era in uso o il suo nuovo nome era occupato: {0}</value></data>
|
||||
<data name="Archive.Log.ReorganizeFilesKept" xml:space="preserve"><value>Nomi dei file mantenuti, foto cambiate dopo il piano: {0}</value></data>
|
||||
|
||||
Reference in new issue
Block a user