fix(archive): a rebase moves no row of the sequence that took the old folder; writers refuse a folder another sequence holds
Round 4 let every row under the old folder follow when that folder holds another sequence now. When the scan took the new holder first, its own row (already rebased into the old folder) then followed the moving sequence too and named that sequence's file, leaving its own export without a row; a second scan did not repair it. Only the moving sequence's own rows now follow because the old folder is taken, and a row of the sequence holding the old folder never follows: its export is in its own folder whatever the other one took along under the same name. The rebase callback now gets the owner of each row. Writers that file into the folder the index has for a sequence checked only that the folder existed. After another index moved the sequence away and another one into that folder, Take server wrote the server's settings into the other sequence's project.json, Save both wrote this PC's copy into its .chronos, and a render sent for the sequence was filed among its exports. SequenceFolders.Holds treats a folder whose sidecar names another sequence exactly like a missing one, and every such writer asks it: settings sync and conflict resolution (Errors.Archive.FolderMoved), Save both's copy and its clean-up, server render filing (503 folder_moved, the upload kept), export downloads, render jobs as they start, proxies sent and proxy passes, the deep analysis checkpoint and the editor's project save. A thumbnail pass refuses a sidecar of another sequence before it opens the pack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit b406a4f6a9a7a3121e9e40289663fb62ee31948e)
This commit is contained in:
1 parent
26b03d1c6d
commit
8c2b9f1bfe
17 files changed
+260
-57
No files matched your search
@@ -289,6 +289,33 @@ public sealed class ProjectStoreTests(TestContext context)
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task ASaveNeverWritesIntoAnotherSequenceMovedIntoTheFolder()
|
||||
{
|
||||
var (db, sequenceId, root) = await ArchiveAsync(4);
|
||||
await using (db)
|
||||
{
|
||||
await using var source = new LocalSequenceSource(db, sequenceId, DecoderFactory.CreateClient(null), null,
|
||||
new ArchiveServiceOptions { Owner = "test", LeaseWait = TimeSpan.FromSeconds(20) });
|
||||
var content = await source.LoadAsync(context.Cancellation);
|
||||
|
||||
// A server sharing the archive moved the folder away, then another sequence into the folder it left; this index
|
||||
// finds both at its next scan.
|
||||
var paths = new ArchivePaths(root);
|
||||
Directory.Move(paths.Sequence("Synthetic").Folder, paths.Sequence("Moved").Folder);
|
||||
var stranger = paths.Sequence("Synthetic");
|
||||
Directory.CreateDirectory(stranger.MetaDirectory);
|
||||
ManifestStore.WriteSequence(stranger.ManifestPath, ManifestStore.ReadSequence(paths.Sequence("Moved").ManifestPath) with { Id = Guid.NewGuid() });
|
||||
const string theirs = """{"exposure":{"deflickerWindow":{"isAuto":false,"manual":7}}}""";
|
||||
await File.WriteAllTextAsync(stranger.ProjectPath, theirs, context.Cancellation);
|
||||
var gone = await Assert.ThrowsAsync<EditorException>(() => source.SaveProjectAsync(content.Project with { HeroFrame = 1 }, content.Project, context.Cancellation));
|
||||
|
||||
Assert.Equal(Loc.L("Editor.Error.Missing"), gone.Message);
|
||||
Assert.Equal(theirs, await File.ReadAllTextAsync(stranger.ProjectPath, context.Cancellation), "the other sequence's project is untouched");
|
||||
Assert.Equal(content.Sequence.SettingsVersion, (await db.Sequences.GetAsync(sequenceId))!.SettingsVersion, "nothing recorded");
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task JobsGoToTheEngine()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user