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:
1 parent
6daf5fa056
commit
09fcff4eb2
13 files changed
+210
-226
No files matched your search
@@ -74,6 +74,12 @@ public sealed partial class WorkspaceHost
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A move of the workspace folder followed here ended, however it ended (any thread): the folder in use may have changed,
|
||||
/// and the workspace is no longer held for it (Settings › Workspace shows the folder and what it takes again).
|
||||
/// </summary>
|
||||
public event Action? MoveEnded;
|
||||
|
||||
/// <summary>
|
||||
/// A move stopped before it ended: the folder in use holds its journal and no move job waits, runs or is paused. Null
|
||||
/// when there is none (a move under way is no move to take up). A move job waiting at start is followed from now on,
|
||||
@@ -230,8 +236,10 @@ public sealed partial class WorkspaceHost
|
||||
if (job.Kind != JobKind.WorkspaceMove || job.State is not (JobState.Done or JobState.Failed or JobState.Cancelled)) return;
|
||||
lock (_gate)
|
||||
{
|
||||
if (_moveJob == job.Id) _moveJob = Guid.Empty;
|
||||
if (_moveJob != job.Id) return;
|
||||
_moveJob = Guid.Empty;
|
||||
}
|
||||
MoveEnded?.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>A project as the move's plan lists it, read from the workspace alone (its versions not sent, its ledger, its changes).</summary>
|
||||
@@ -244,7 +252,7 @@ public sealed partial class WorkspaceHost
|
||||
try
|
||||
{
|
||||
var status = await Sync.StatusAsync(folder.ProjectId, null, cancellationToken).ConfigureAwait(false);
|
||||
var renders = UnsentRenders(project);
|
||||
var renders = WorkspaceCleaner.UnsentRenders(project);
|
||||
return new WorkspaceMoveProject(folder.ProjectId, entry.Name, folder.Files, folder.Bytes, status.Ahead + status.Damaged + renders > 0 || status.Conflict is not null,
|
||||
status.Modified && !status.ReadOnly);
|
||||
}
|
||||
@@ -253,18 +261,5 @@ public sealed partial class WorkspaceHost
|
||||
Log.Info("workspace", $"Where project {folder.ProjectId} stands could not be read for the move's plan: {ex.Message}");
|
||||
return new WorkspaceMoveProject(folder.ProjectId, entry.Name, folder.Files, folder.Bytes, true, false);
|
||||
}
|
||||
|
||||
static int UnsentRenders(WorkspaceProject project)
|
||||
{
|
||||
try
|
||||
{
|
||||
return project.ReadRenders().Unsent.Count;
|
||||
}
|
||||
catch (InvalidDataException)
|
||||
{
|
||||
// A ledger this Chronos cannot read: what it lists is not known to be at the home.
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user