feat(copies): matches between this PC and the server, Integrate and merge (owner review 6, v1.2.0) (#74)
CI / Build and test (push) Successful in 13m44s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 16s
Release / Build, test and publish (push) Successful in 26m34s
CI / PostgreSQL 16 integration (push) Failing after 17m36s
CI / PostgreSQL 17 integration (push) Failing after 15m36s
CI / Docker image (push) Successful in 1m12s
Release / Server image (push) Failing after 15s
CI / Build and test (push) Successful in 13m44s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 16s
Release / Build, test and publish (push) Successful in 26m34s
CI / PostgreSQL 16 integration (push) Failing after 17m36s
CI / PostgreSQL 17 integration (push) Failing after 15m36s
CI / Docker image (push) Successful in 1m12s
Release / Server image (push) Failing after 15s
The same time-lapse on a server and on this PC under different ids, or twice on this PC, is recognised, compared and settled as the owner asked in owner review 6. Matches are found after each sync refresh, through the server's new photo lookup, and after the jobs that change photos. The default is to ask every time. Server › Matches offers: - Keep apart, which is remembered; - Link only and Unlink; - the Compare dialog: photos, details line by line, projects and the plan. Integrate completes both sides. Photos default to Union, projects are copied across, and a losing version goes to the trash only after a hash check. Afterwards new photos move by themselves, and deletions wait for the user. A merge of two local sequences verifies every photo before the other sequence goes to its archive's trash. Upload all local skips suspected matches and flags them. Migration 0012 adds the found_copies and copy_probes tables. Jobs 25 (Integrate) and 26 (MergeSequences) are new, and so are the server capabilities photo-lookup and upload-into. Refs #73 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 #74.
This commit is contained in:
1 parent
43719bb5c5
commit
f33bcac32e
586 files changed
+41546
-280
No files matched your search
@@ -16,8 +16,6 @@ namespace Chronos.App.Tests.Setup;
|
||||
/// </summary>
|
||||
public sealed class SetupEngineTests(TestContext context)
|
||||
{
|
||||
private const string TestsKey = @"Software\Chronos.Tests";
|
||||
|
||||
/// <summary>The StartupApproved state Task Manager writes for an entry it turned off.</summary>
|
||||
private static readonly byte[] TurnedOff = [0x03, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||
|
||||
@@ -64,7 +62,7 @@ public sealed class SetupEngineTests(TestContext context)
|
||||
{
|
||||
var folder = Path.Combine(context.CreateTempDirectory("services"), "Apps");
|
||||
var owned = CommandProgram.FullPaths(folder, ["Chronos.Server.exe", "Chronos.exe", "lib/Chronos.Core.dll"]);
|
||||
var keyPath = TestsKey + @"\" + Guid.NewGuid().ToString("N");
|
||||
var keyPath = ScratchRegistry.Create();
|
||||
try
|
||||
{
|
||||
using var services = Registry.CurrentUser.CreateSubKey(keyPath, writable: true);
|
||||
@@ -88,7 +86,7 @@ public sealed class SetupEngineTests(TestContext context)
|
||||
}
|
||||
finally
|
||||
{
|
||||
DeleteTestKey(keyPath);
|
||||
ScratchRegistry.Delete(keyPath);
|
||||
}
|
||||
|
||||
static void Service(RegistryKey services, string name, int type, string imagePath)
|
||||
@@ -158,7 +156,7 @@ public sealed class SetupEngineTests(TestContext context)
|
||||
public void UninstallRemovesOnlyTheSignInEntriesOfTheProgramsItRemoves()
|
||||
{
|
||||
var folder = Path.Combine(context.CreateTempDirectory("startup"), "Apps");
|
||||
var keyPath = TestsKey + @"\" + Guid.NewGuid().ToString("N");
|
||||
var keyPath = ScratchRegistry.Create();
|
||||
try
|
||||
{
|
||||
using (var run = Registry.CurrentUser.CreateSubKey(keyPath + @"\Run", writable: true))
|
||||
@@ -182,7 +180,7 @@ public sealed class SetupEngineTests(TestContext context)
|
||||
}
|
||||
finally
|
||||
{
|
||||
DeleteTestKey(keyPath);
|
||||
ScratchRegistry.Delete(keyPath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +189,6 @@ public sealed class SetupEngineTests(TestContext context)
|
||||
public void AnUpgradeMovesTheSignInEntryOfARenamedProgramAndRemovesThatOfADroppedOne()
|
||||
{
|
||||
var folder = Path.Combine(context.CreateTempDirectory("upgrade"), "Apps");
|
||||
var keyPath = TestsKey + @"\" + Guid.NewGuid().ToString("N");
|
||||
// This version ships the client as Chronos.exe (the previous one as Chronos.old.exe), and the user left out the Uploader.
|
||||
var manifest = Manifest();
|
||||
manifest.Components.Add(new PayloadComponent { Id = "Uploader", DisplayName = "Chronos Uploader", DefaultSelected = true });
|
||||
@@ -200,6 +197,7 @@ public sealed class SetupEngineTests(TestContext context)
|
||||
var programs = InstallEngine.StartupPrograms(manifest, folder, ["Chronos", "Server"]);
|
||||
Assert.SequenceEqual(["Chronos"], programs.Keys);
|
||||
Assert.Equal(Path.Combine(folder, "Chronos.exe"), programs["Chronos"]);
|
||||
var keyPath = ScratchRegistry.Create();
|
||||
try
|
||||
{
|
||||
using (var run = Registry.CurrentUser.CreateSubKey(keyPath + @"\Run", writable: true))
|
||||
@@ -226,7 +224,7 @@ public sealed class SetupEngineTests(TestContext context)
|
||||
}
|
||||
finally
|
||||
{
|
||||
DeleteTestKey(keyPath);
|
||||
ScratchRegistry.Delete(keyPath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,15 +342,6 @@ public sealed class SetupEngineTests(TestContext context)
|
||||
Assert.Equal("Something else", InstallEngine.FileTypeName(unknown, CultureInfo.GetCultureInfo("it")));
|
||||
}
|
||||
|
||||
/// <summary>Deletes a scratch key under <see cref="TestsKey"/>, and that key too once it is empty.</summary>
|
||||
private static void DeleteTestKey(string keyPath)
|
||||
{
|
||||
Registry.CurrentUser.DeleteSubKeyTree(keyPath, throwOnMissingSubKey: false);
|
||||
bool empty;
|
||||
using (var tests = Registry.CurrentUser.OpenSubKey(TestsKey)) empty = tests is { SubKeyCount: 0, ValueCount: 0 };
|
||||
if (empty) Registry.CurrentUser.DeleteSubKey(TestsKey, throwOnMissingSubKey: false);
|
||||
}
|
||||
|
||||
/// <summary>A manifest under a product name no machine has installed, so the registry holds no installation of it.</summary>
|
||||
private static PayloadManifest Manifest() => new()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user