fix: wire the owner review 5 parcels together; docs
The six parcels of owner review 5 merged into or5-v1.1 need a few joins that no single parcel owned: - The workspace copy and send jobs compare a project's home server through WorkspaceJobOptions.SameServer, so a job queued under a server's 1.0 address still runs once its home is re-keyed to the server id (plan step S3), with a test against a real server. - The sample data gives its running and paused jobs a progress detail (SampleJobDetails), so the captures show the status line. - The Windows service strings (Server.Service.*) went with the service hosting; they are removed line by line from all 38 cultures. - The VS Code launch and build task start Chronos.Server.Host, now that Chronos.Server is a library. Docs: CHANGELOG [Unreleased], DECISIONS rows, BRIEF amendments and the section 24 rows for R1-R4, ARCHITECTURE, the deploy guides (Chronos Server in Docker only; on Windows Chronos Desktop shares its library), both READMEs and STATUS (owner review 5 in progress for v1.1.0). Refs #64 #65 #66 #67 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e367f03c80
commit
817956e719
54 files changed
+578
-250
No files matched your search
@@ -233,6 +233,32 @@ public sealed class ServerWorkspaceTests(TestContext context)
|
||||
Assert.Null(a.Store.Find(main.Id)!.ReadMedia());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task ACopyQueuedUnderTheAddressRunsOnAProjectReKeyedToTheServersId()
|
||||
{
|
||||
await using var server = await TestServer.StartAsync(context, services: ArchiveModule.Register);
|
||||
var (_, _, token) = await server.UserAsync("alberto", "editor");
|
||||
var sid = await SequenceAsync(server, token, 2);
|
||||
var id = Guid.CreateVersion7();
|
||||
var idKey = ServerIdentity.IdKey(id);
|
||||
ServerIdentity? identity = null;
|
||||
await using var a = await WorkspaceClient.StartAsync(context, server, token, "PC-A", sameServer: (x, y) => identity!.Same(x, y));
|
||||
identity = ServerIdentity.None.With(id, a.Server);
|
||||
// The project's home names the server by its id (re-keyed at sign-in, owner review 5); the job still names the address.
|
||||
var home = new ServerProjectHome(a.Client, sid, "Test server", server: idKey);
|
||||
var main = (await home.ListAsync(context.Cancellation)).Single();
|
||||
var project = await a.Sync.CheckoutAsync(home, main.Id, cancellationToken: context.Cancellation);
|
||||
Assert.Equal(idKey, project.ReadBundle().Workspace!.Home.Server);
|
||||
|
||||
var job = await a.EnqueueAsync(WorkspaceJobs.CopyFromServer(sid, Title, a.Server, a.Store.Root, main.Id));
|
||||
await a.WaitAsync(job.Id, JobState.Done);
|
||||
Assert.Equal(2, Assert.NotNull(project.ReadMedia()).Frames.Count);
|
||||
|
||||
// Another server is still another home.
|
||||
var other = await a.EnqueueAsync(WorkspaceJobs.CopyFromServer(sid, Title, "https://elsewhere:8443", a.Store.Root, main.Id));
|
||||
Assert.Equal(Loc.L("Errors.Workspace.OtherHome"), (await a.WaitAsync(other.Id, JobState.Failed)).Error);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TheOriginalsAreDownloadedCheckedAndKeptBesideTheProxies()
|
||||
{
|
||||
@@ -560,7 +586,7 @@ public sealed class ServerWorkspaceTests(TestContext context)
|
||||
public bool Connected { get; set; } = true;
|
||||
|
||||
public static async Task<WorkspaceClient> StartAsync(TestContext context, TestServer server, string token, string name, HttpMessageHandler? handler = null,
|
||||
Func<bool>? hold = null)
|
||||
Func<bool>? hold = null, Func<string?, string?, bool>? sameServer = null)
|
||||
{
|
||||
var db = await ChronosDatabase.OpenAsync(DatabaseOptions.Sqlite(Path.Combine(context.CreateTempDirectory(name + "-db"), "chronos.db")), context.Cancellation);
|
||||
var archives = new ArchiveService(db, new ArchiveServiceOptions { Owner = name });
|
||||
@@ -568,7 +594,8 @@ public sealed class ServerWorkspaceTests(TestContext context)
|
||||
var archive = await archives.CreateAsync(context.CreateTempDirectory(name + "-archive"), "Local", cancellationToken: context.Cancellation);
|
||||
var client = new ChronosClient(server.HttpBase, new CertificatePinning([]), name, handler) { Token = token };
|
||||
WorkspaceClient? created = null;
|
||||
var options = hold is null ? WorkspaceJobOptions.For(archives) : WorkspaceJobOptions.For(archives) with { HoldTransfers = hold };
|
||||
var options = WorkspaceJobOptions.For(archives) with { SameServer = sameServer };
|
||||
if (hold is not null) options = options with { HoldTransfers = hold };
|
||||
var engine = new JobEngine(db, WorkspaceJobs.CreateHandlers(db, archives, new Connector(client, () => created?.Connected ?? true), options),
|
||||
new JobEngineOptions { Workers = 1, WorkerId = name, PollInterval = TimeSpan.FromMilliseconds(50), CheckpointInterval = TimeSpan.FromMilliseconds(50) });
|
||||
await engine.StartAsync(context.Cancellation);
|
||||
|
||||
Reference in new issue
Block a user