feat: owner review 2 phase 5b: the server as a project home (#17)
CI / Build and test (push) Successful in 9m58s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 6s
Release / Build, test and publish (push) Successful in 14m8s
CI / PostgreSQL 16 integration (push) Successful in 8m55s
CI / PostgreSQL 17 integration (push) Successful in 8m50s
CI / Docker image (push) Successful in 57s
Release / Server image (push) Successful in 1m22s
CI / Build and test (push) Successful in 9m58s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 6s
Release / Build, test and publish (push) Successful in 14m8s
CI / PostgreSQL 16 integration (push) Successful in 8m55s
CI / PostgreSQL 17 integration (push) Successful in 8m50s
CI / Docker image (push) Successful in 57s
Release / Server image (push) Successful in 1m22s
A Chronos Server keeps its sequences' projects, as a PC's archive does: Main and named projects with versions under /api/v1/sequences/{id}/projects, the projects capability and the projectChanged event. The desktop opens a server's sequences in the workspace (proxies downloaded, hash-checked, resumable) with Save version, Sync, conflicts, History, Restore and the project actions against the server. Renders can be of a project version. The admin panel lists a sequence's projects and versions. Strings in all 38 languages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #17.
This commit is contained in:
1 parent
255e149087
commit
81c303f484
325 files changed
+11477
-516
No files matched your search
@@ -197,6 +197,41 @@ internal sealed class CountingHome(IProjectHome home) : IProjectHome
|
||||
public Task<PushResult> PushAsync(Guid projectId, ProjectVersion version, CancellationToken cancellationToken) => home.PushAsync(projectId, version, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A home whose list of projects fails with an error no other call gives (a server's 403 or 500 passed through as it is), the
|
||||
/// rest passed through.
|
||||
/// </summary>
|
||||
internal sealed class FailingListHome(IProjectHome home) : IProjectHome
|
||||
{
|
||||
public int Lists { get; private set; }
|
||||
|
||||
public Task<IReadOnlyList<SequenceProject>> ListAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
Lists++;
|
||||
throw new InvalidOperationException("The server refused the list (403).");
|
||||
}
|
||||
|
||||
public Task<HomeSequence> SequenceAsync(CancellationToken cancellationToken) => home.SequenceAsync(cancellationToken);
|
||||
|
||||
public Task<SequenceProject> CreateAsync(string name, Guid? fromVersionId, string? author, CancellationToken cancellationToken) =>
|
||||
home.CreateAsync(name, fromVersionId, author, cancellationToken);
|
||||
|
||||
public Task<ProjectVersion> HeadAsync(Guid projectId, CancellationToken cancellationToken) => home.HeadAsync(projectId, cancellationToken);
|
||||
|
||||
public Task<ProjectVersion?> GetVersionAsync(Guid projectId, Guid versionId, CancellationToken cancellationToken) =>
|
||||
home.GetVersionAsync(projectId, versionId, cancellationToken);
|
||||
|
||||
public Task<IReadOnlyList<ProjectVersion>> VersionsAfterAsync(Guid projectId, int afterNumber, int limit, CancellationToken cancellationToken) =>
|
||||
home.VersionsAfterAsync(projectId, afterNumber, limit, cancellationToken);
|
||||
|
||||
public Task<IReadOnlyList<ProjectVersion>> HistoryAsync(Guid projectId, int? beforeNumber, int limit, CancellationToken cancellationToken) =>
|
||||
home.HistoryAsync(projectId, beforeNumber, limit, cancellationToken);
|
||||
|
||||
public Task<PushResult> PushAsync(Guid projectId, ProjectVersion version, CancellationToken cancellationToken) => home.PushAsync(projectId, version, cancellationToken);
|
||||
|
||||
public Task<HomeFrames> FramesAsync(CancellationToken cancellationToken) => home.FramesAsync(cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>A home that cannot be reached, standing for a server out of reach or an archive offline.</summary>
|
||||
internal sealed class UnreachableHome(IProjectHome home) : IProjectHome
|
||||
{
|
||||
|
||||
@@ -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