fix(sync): resolve conflicts against the versions shown, isolate failures, renders on request
- Conflicts are settled against the versions the user was shown; a later change on
either side refuses the choice and compares again. Title, tags, rating and notes
changed differently on both sides are a conflict too (no silent tag union).
- Links are written under the engine's gate and forgotten only after a 404; linked
local copies are read by id; unlinked copies with the same originals are linked
by content.
- A failure on one sequence is recorded on its link; the others are still compared.
- Downloads hash unverified local copies first and restore originals missing here.
- Background proxy downloads give way to the user's requests; "Keep proxies offline"
refreshes the caches of sequences opened with proxies, checks free space and backs
off after a failure.
- Renders travel on request: Send exports (chunked, hash-verified upload keeping the
render id; new POST /sequences/{id}/renders endpoints) and Get exports.
- Server screen: stable row buttons, mockup column grid, Tab through rows, conflict
rows first on the card colour, localised conflict detail, Save both confirmation,
Pause metered uploads, culture switch, Library one-word sync glyphs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
48 files changed
+2498
-465
No files matched your search
@@ -38,9 +38,9 @@ public sealed class SyncTextTests
|
||||
[Test]
|
||||
public void RightsFollowTheServerPermissions()
|
||||
{
|
||||
Assert.Equal(new SyncRights(true, true), Editor);
|
||||
Assert.Equal(new SyncRights(false, false), Viewer);
|
||||
Assert.Equal(new SyncRights(false, true), SyncRights.Of((long)Permissions.RenderNode));
|
||||
Assert.Equal(new SyncRights(true, true, true), Editor);
|
||||
Assert.Equal(new SyncRights(false, false, false), Viewer);
|
||||
Assert.Equal(new SyncRights(false, true, false), SyncRights.Of((long)Permissions.RenderNode));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -56,6 +56,19 @@ public sealed class SyncTextTests
|
||||
Assert.SequenceEqual([SyncAction.KeepMine, SyncAction.TakeServer, SyncAction.SaveBoth], SyncText.Actions(Entry(SyncStatus.Conflict), Editor));
|
||||
Assert.Empty(SyncText.Actions(Entry(SyncStatus.InSync), Editor));
|
||||
|
||||
// Without the edit right nothing of this PC is sent: no "Keep mine", no settings push.
|
||||
Assert.SequenceEqual([SyncAction.TakeServer, SyncAction.SaveBoth], SyncText.Actions(Entry(SyncStatus.Conflict), Viewer));
|
||||
Assert.Empty(SyncText.Actions(Entry(SyncStatus.LocalAhead), Viewer));
|
||||
Assert.SequenceEqual([SyncAction.SyncSettings], SyncText.Actions(Entry(SyncStatus.ServerAhead), Viewer));
|
||||
|
||||
// Renders travel on request once the originals agree.
|
||||
var exports = Link with { ExportsToGet = 3, ExportsToGetBytes = 1_900_000_000, ExportsToSend = 1, ExportsToSendBytes = 600_000_000 };
|
||||
Assert.SequenceEqual([SyncAction.GetExports, SyncAction.SendExports], SyncText.Actions(Entry(SyncStatus.InSync, exports), Editor));
|
||||
Assert.SequenceEqual([SyncAction.GetExports], SyncText.Actions(Entry(SyncStatus.InSync, exports), Viewer));
|
||||
Assert.SequenceEqual([SyncAction.KeepMine, SyncAction.TakeServer, SyncAction.SaveBoth], SyncText.Actions(Entry(SyncStatus.Conflict, exports), Editor));
|
||||
Assert.Equal(Loc.Plural("Tooltips.Server.Sync.GetExports", 3, Titano.App.Infrastructure.Formatting.Bytes(1_900_000_000)),
|
||||
SyncText.ToolTip(Entry(SyncStatus.InSync, exports), SyncAction.GetExports));
|
||||
|
||||
Assert.SequenceEqual([SyncAction.Pause], SyncText.Actions(Entry(SyncStatus.Transferring, transfer: Upload(JobState.Running)), Editor));
|
||||
Assert.SequenceEqual([SyncAction.Pause], SyncText.Actions(Entry(SyncStatus.Transferring, transfer: Upload(JobState.Queued)), Editor));
|
||||
Assert.SequenceEqual([SyncAction.Resume], SyncText.Actions(Entry(SyncStatus.Transferring, transfer: Upload(JobState.Paused)), Editor));
|
||||
@@ -93,14 +106,32 @@ public sealed class SyncTextTests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AConflictNamesTheSettingsThatDiffer()
|
||||
public void AConflictNamesTheSettingsThatDifferInWords()
|
||||
{
|
||||
var conflict = Entry(SyncStatus.Conflict, Link with { ConflictSettingsJson = """{"exposure":{"deflickerWindow":{"isAuto":false,"manual":33}}}""" });
|
||||
var theirs = new SyncPayload(Local.Title, ["boats"], 0, null, """{"exposure":{"deflickerWindow":{"isAuto":false,"manual":33},"deflicker":{"isAuto":false,"manual":true}}}""");
|
||||
var conflict = Entry(SyncStatus.Conflict, Link with { ConflictRemote = theirs });
|
||||
|
||||
var text = SyncText.State(conflict).ToolTip;
|
||||
var lines = SyncText.Conflict(conflict, 10);
|
||||
|
||||
Assert.Equal(Loc.L("Server.Conflict.Difference", "exposure.deflickerWindow.manual", "41", "33"), text);
|
||||
Assert.Equal(Loc.L("Tooltips.Server.Sync.State.Conflict"), SyncText.Conflict(Entry(SyncStatus.Conflict)));
|
||||
Assert.SequenceEqual(
|
||||
[
|
||||
Loc.L("Server.Conflict.Difference", Loc.L("Server.Setting.Tags"), Loc.L("Server.Sync.None"), "boats"),
|
||||
Loc.L("Server.Conflict.Difference", Loc.L("Server.Setting.Deflicker"), Loc.L("Server.Setting.Auto"), Loc.L("Server.Setting.Manual")),
|
||||
Loc.L("Server.Conflict.Difference", Loc.L("Server.Setting.DeflickerWindow"), "41", "33"),
|
||||
], lines);
|
||||
// The State tooltip is one line: the first difference and how many more.
|
||||
Assert.Equal(Loc.L("Server.Conflict.More", lines[0], "2"), SyncText.State(conflict).ToolTip);
|
||||
Assert.False(SyncText.State(conflict).ToolTip.Contains('\n', StringComparison.Ordinal), "one line");
|
||||
Assert.Equal(Loc.L("Tooltips.Server.Sync.State.Conflict"), SyncText.ConflictSummary(Entry(SyncStatus.Conflict)));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ASequenceThatCouldNotBeComparedSaysWhy()
|
||||
{
|
||||
var (kind, text, tip) = SyncText.State(Entry(SyncStatus.InSync, Link with { Error = "403 forbidden" }));
|
||||
|
||||
Assert.Equal((StatusKind.Warning, Loc.L("Server.Sync.State.Failed")), (kind, text));
|
||||
Assert.Contains("403 forbidden", tip);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
Reference in new issue
Block a user