From 488b588ad986eea97df34be8c157de7c04054741 Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Tue, 3 Nov 2026 12:26:18 +0100 Subject: [PATCH] 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 --- .../Workspaces/WorkspaceRecoveryTests.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/Chronos.Data.Tests/Workspaces/WorkspaceRecoveryTests.cs b/tests/Chronos.Data.Tests/Workspaces/WorkspaceRecoveryTests.cs index fe5266ff..0cb89b11 100644 --- a/tests/Chronos.Data.Tests/Workspaces/WorkspaceRecoveryTests.cs +++ b/tests/Chronos.Data.Tests/Workspaces/WorkspaceRecoveryTests.cs @@ -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));