fix: integrate phase 5a fix round 2

Taking the server's values no longer saves the working state as a
version first (the desktop fix), so a take refused by a home that
holds no versions after the base leaves the local versions as they
were. The recovery test that relied on that pre-commit now saves the
unsaved stack change itself before pushing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-03 12:26:18 +01:00
1 parent 47c660735f
commit 488b588ad9
1 file changed
+5 -3
@@ -252,10 +252,12 @@ public abstract class WorkspaceRecoveryTests(TestContext context) : DatabaseTest
Assert.Equal(WorkspaceState.Conflict, (await three.ResolveAsync(id, forgetful, ConflictChoice.KeepMine, cancellationToken: fx.Ct)).Status.State);
Assert.Equal(WorkspaceState.Conflict, (await three.ResolveAsync(id, forgetful, ConflictChoice.TakeServer, cancellationToken: fx.Ct)).Status.State);
Assert.Equal(recorded.TheirsVersionId, project.ReadSync().Conflict!.TheirsVersionId);
Assert.Equal("bright", three.Unpushed(id)[0].Note);
// Taking the server's saves nothing first, so the refused take left the versions as they were.
Assert.Equal("bright", three.Unpushed(id).Single().Note);
// Back as it was, the home settles it as the user chooses.
await three.ResolveAsync(id, fx.Home, ConflictChoice.KeepMine, cancellationToken: fx.Ct);
// Back as it was, the home settles it as the user chooses; the unsaved stack change stays in the working state.
Assert.True((await three.ResolveAsync(id, fx.Home, ConflictChoice.KeepMine, cancellationToken: fx.Ct)).Status.Modified);
await three.CommitAsync(id, cancellationToken: fx.Ct);
Assert.Equal(WorkspaceState.InSync, (await three.PushAsync(id, fx.Home, fx.Ct)).Status.State);
var head = Settings(await fx.Home.HeadAsync(id, fx.Ct));
Assert.Equal((2, StackSetting.StarTrails), (head.Exposure.ExposureOffsetEv, head.Stack.Mode));