fix(workspace): close the phase 5c review findings
Originals are now judged by their bytes, never by the media index: a removal or clean-up hashes every file under media/originals and deletes it only when the home holds that SHA-256; every other file, named or not, goes to the workspace trash. Trash entries are filled under a staging name that Empty never lists. A ledger can only name files inside exports/. Jobs follow the workspace: a copy, render or send resolves the folder that holds its project now (a moved workspace, a retry after a move) and waits while a move has not switched yet. A clean-up failure after the switch is a warning that keeps the journal for a later resume; entries that changed since they were copied are kept, and a same-volume rename refused across volumes falls back to copy and verify. Sends map a replayed version by content hash, or go with the project only, and note an old server that drops provenance. The media index (format 2) and project file (format 3) refuse older readers while they hold originals. Metered connections also hold sync downloads and server copies. The editor gains Send again, the Settings page can resume a stopped move, the disabled tooltips say why, and unused strings are pruned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
09fcff4eb2
commit
2654683a12
125 files changed
+1618
-401
No files matched your search
@@ -38,7 +38,7 @@ public sealed class ProjectBundleTests(TestContext context)
|
||||
// The archive's own meta files are JSON too, but not project files.
|
||||
Assert.Throws<InvalidDataException>(() => ProjectBundle.Parse("""{ "schemaVersion": 1, "id": "0192a4c1-7b3e-7cc0-8a51-2f9d0e6b1a01" }"""));
|
||||
var json = Sample().ToJson();
|
||||
Assert.Throws<InvalidDataException>(() => ProjectBundle.Parse(json.Replace("\"formatVersion\": 1", "\"formatVersion\": 3", StringComparison.Ordinal)));
|
||||
Assert.Throws<InvalidDataException>(() => ProjectBundle.Parse(json.Replace("\"formatVersion\": 1", $"\"formatVersion\": {ProjectBundle.CurrentFormatVersion + 1}", StringComparison.Ordinal)));
|
||||
Assert.Throws<InvalidDataException>(() => ProjectBundle.Parse(json.Replace(SequenceId.ToString(), "not-a-guid", StringComparison.Ordinal)));
|
||||
Assert.Throws<InvalidDataException>(() => ProjectBundle.Parse(json.Replace("\"version\": 1", "\"version\": 99", StringComparison.Ordinal)));
|
||||
Assert.Throws<InvalidDataException>(() => ProjectBundle.Parse(json.Replace("\"folder\"", "\"place\"", StringComparison.Ordinal)));
|
||||
@@ -62,6 +62,12 @@ public sealed class ProjectBundleTests(TestContext context)
|
||||
Assert.Equal(bundle.Project.ToJson(), back.Project.ToJson());
|
||||
Assert.False(back.IsReadOnly);
|
||||
|
||||
// Holding the originals: format 3, which a Chronos before phase 5c refuses as newer rather than reading as proxies.
|
||||
var originals = bundle with { Workspace = workspace with { Media = new BundleMedia(BundleMedia.Originals, 12) } };
|
||||
Assert.Contains("\"formatVersion\": 3", originals.ToJson());
|
||||
Assert.Equal(BundleMedia.Originals, ProjectBundle.Parse(originals.ToJson()).Workspace!.Media.Kind);
|
||||
Assert.Equal(3, ProjectBundle.CurrentFormatVersion);
|
||||
|
||||
// A server home names its server; a project not pulled yet has no base.
|
||||
var remote = workspace with { Home = new BundleHome(BundleHome.ServerKind, SequenceId, Server: "https://nas:8443"), Base = null, IsMain = true };
|
||||
Assert.Equal(remote, ProjectBundle.Parse((bundle with { Workspace = remote }).ToJson()).Workspace);
|
||||
|
||||
Reference in new issue
Block a user