fix(workspace): a pull that succeeded never fails on the name it follows
The name follow after a pull caught only the home's own exceptions, so a 403 or any other error from the home's list (or a bundle in use) made a pull that had already pulled and replayed report a failure. It is now logged as a warning and the name is followed at the next pull; a cancellation still passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ab6cad51b2
commit
5ff9c086fd
3 files changed
+73
-6
No files matched your search
@@ -256,6 +256,29 @@ public abstract class WorkspaceTests(TestContext context) : DatabaseTest(context
|
||||
Assert.SequenceEqual([0], working.ExcludedFrames);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task APullThatSucceededNeverFailsOnTheNameItFollows()
|
||||
{
|
||||
var fx = await FixtureAsync();
|
||||
var (_, one) = fx.Workspace("one");
|
||||
var (_, two) = fx.Workspace("two");
|
||||
var id = (await fx.CheckoutAsync(one)).ProjectId;
|
||||
await fx.CheckoutAsync(two, id);
|
||||
await EditAsync(one, id, s => s with { Stack = new StackSettings { Mode = StackSetting.Median } }, fx.Ct);
|
||||
await one.CommitAsync(id, cancellationToken: fx.Ct);
|
||||
await one.PushAsync(id, fx.Home, fx.Ct);
|
||||
|
||||
// The home refuses its list (a server's 403) when the pull, done, follows the project's name: the pull stands.
|
||||
var home = new FailingListHome(fx.Home);
|
||||
var name = two.Store.Find(id)!.ReadBundle().Workspace!.Name;
|
||||
var pulled = await two.PullAsync(id, home, fx.Ct);
|
||||
Assert.Equal(1, home.Lists);
|
||||
Assert.Equal((1, WorkspaceState.InSync), (pulled.Pulled.Count, pulled.Status.State));
|
||||
Assert.Equal(StackSetting.Median, (await two.OpenAsync(id, fx.Ct)).Working.Stack.Mode);
|
||||
Assert.Equal(name, two.Store.Find(id)!.ReadBundle().Workspace!.Name);
|
||||
Assert.False(await two.FollowNameAsync(id, home, fx.Ct));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task SeveralLocalVersionsAreReplayedOnTopOfTheHomesWhenItMovedMeanwhile()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user