fix: integrate phase 5a fix round 1
Taking the server's values now saves unsaved changes as a version first (desktop fix), while a conflict of format refuses that choice (merge fix): the save is skipped for a conflict of format, so a refused choice leaves the local versions as they were. A project that moves onto a newer Chronos's head with nothing of its own now adopts the home's copies of the local versions the home already held, as a replay does, since the replay no longer writes over unsent files before the base moves (workspace fix). The recovery test of a conflict met past a held version checks the versions before the one Take the server's saves first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1a35fcdb27
commit
8256b72913
2 files changed
+4
-2
No files matched your search
@@ -330,7 +330,8 @@ public sealed class WorkspaceSync(WorkspaceStore store, string clientName)
|
||||
if (sync.Conflict is not { } recorded) return new WorkspaceSyncResult(await StatusLockedAsync(project, home, cancellationToken).ConfigureAwait(false), [], []);
|
||||
if (choice == ConflictChoice.SaveBoth)
|
||||
return await SaveBothAsync(project, bundle, home, saveBothName, cancellationToken).ConfigureAwait(false);
|
||||
if (choice == ConflictChoice.TakeServer && !bundle.IsReadOnly) CommitLocked(project, bundle, null, null);
|
||||
// A conflict of format refuses the choice (nothing is merged with a newer Chronos's settings): nothing is saved first.
|
||||
if (choice == ConflictChoice.TakeServer && !bundle.IsReadOnly && !recorded.NewerFormat) CommitLocked(project, bundle, null, null);
|
||||
IReadOnlySet<string> takeTheirs = choice == ConflictChoice.TakeServer ? AllPaths : takeServer ?? new HashSet<string>();
|
||||
ProjectSettings? kept = null;
|
||||
var (_, conflict, pulled) = await ReplayAsync(project, bundle, home, takeTheirs, cancellationToken, shown ?? recorded, k => kept = k).ConfigureAwait(false);
|
||||
|
||||
Reference in new issue
Block a user