fix(workspace): join the phase 5c packages at their seams

The local render, the send home, the clean-up, the settings page and the
folder move were built apart; together they left gaps:

- A local render to an image sequence writes a folder, which the send
  took for a missing file. The archive home now files the folder whole
  (checked by its listing hash, as the render recorded it) and the
  clean-up removes a sent folder; a server, which takes one file per
  render, refuses it with Errors.Workspace.SendSequence.
- Rename, delete and Remove local copy are refused while the folder is
  being moved, so no project folder changes under the move.
- Settings > Workspace shows the folder, usage, Move... and Change...
  again when a move ends (WorkspaceHost.MoveEnded).
- Empty... uses the Settings typed confirmation; the separate trash
  dialog, never shown, is removed. The move plan counts unsent renders
  with the clean-up's helper.
- Tests: the follow-up send now runs in the render tests; an end-to-end
  archive-home test (originals, version on render, local render, send
  with project and version, clean-up) and an image-sequence send test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-04 16:23:54 +01:00
1 parent 6daf5fa056
commit 09fcff4eb2
13 files changed
+210 -226

No files matched your search

@@ -117,6 +117,42 @@ public abstract class WorkspaceSendTests(TestContext context) : DatabaseTest(con
Assert.Contains(Loc.L("Archive.Log.WorkspaceSent", project.ReadBundle().Workspace!.Name, 0, 0), nothing.LogTail);
}
[Test]
public async Task AnImageSequenceIsFiledWholeAndCheckedByItsListing()
{
var fx = await FixtureAsync();
var engine = await EngineAsync(fx);
var (store, _, project) = await CheckoutAsync(fx);
var folder = Path.Combine(project.ExportsDirectory, "Main frames");
Directory.CreateDirectory(folder);
for (var i = 0; i < 3; i++) File.WriteAllText(Path.Combine(folder, $"frame-{i:D4}.png"), "frame " + i);
var size = Directory.GetFiles(folder).Sum(f => new FileInfo(f).Length);
var entry = new WorkspaceRenderEntry(Guid.CreateVersion7(), Guid.CreateVersion7(), "Main frames", await WorkspaceRenderJobHandler.HashAsync(folder), size,
"PNG frames", "png", 96, 64, 24, 0.125, project.ProjectId, null, null, Rendered);
project.WriteRenders(project.ReadRenders().With(entry));
await SendAsync(fx, engine, store, project.ProjectId, JobState.Done);
var row = Assert.NotNull(await fx.Db.Renders.GetAsync(entry.RenderId, fx.Ct));
Assert.Equal((size, (Guid?)project.ProjectId), (row.Bytes, row.ProjectId));
var filed = Path.Combine(fx.Archive.Archive.RootPath, row.OutputPath);
Assert.True(Directory.Exists(filed), filed);
Assert.Equal(entry.Sha256, await WorkspaceRenderJobHandler.HashAsync(filed));
Assert.True(project.ReadRenders().Find(entry.RenderId)!.IsSent);
Assert.Empty(Directory.GetFileSystemEntries(fx.Archive.Paths.StagingDirectory, "workspace-render-*"));
// A frame changed after the render: refused, the folder left where it is.
var changed = entry with { RenderId = Guid.CreateVersion7(), File = "Changed frames" };
Directory.CreateDirectory(project.ExportFile(changed.File));
foreach (var file in Directory.GetFiles(folder)) File.Copy(file, Path.Combine(project.ExportFile(changed.File), Path.GetFileName(file)));
File.WriteAllText(Path.Combine(project.ExportFile(changed.File), "frame-0001.png"), "frame X");
project.WriteRenders(project.ReadRenders().With(changed with { State = WorkspaceRenderEntry.Pending, Sent = null }));
var failed = await SendAsync(fx, engine, store, project.ProjectId, JobState.Failed);
Assert.Contains(Loc.L("Errors.Workspace.SendHashMismatch", "Changed frames"), failed.LogTail);
Assert.Null(await fx.Db.Renders.GetAsync(changed.RenderId, fx.Ct));
Assert.True(Directory.Exists(project.ExportFile(changed.File)), "the folder stays in the workspace");
}
[Test]
public async Task AVersionTheHomeLacksIsSentFirst()
{