From d10577b175957745d184a50dfe497291c7f2dba5 Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Tue, 17 Nov 2026 14:03:23 +0100 Subject: [PATCH] fix(copies): close the owner review 6 gaps with tests Photos not sent: automatic photos of an integrated pair that failed three times in a row are now told with an error toast that shows the row, and the row reads "not sent" with the last reason. The matches-found and linked toasts of background detections run from their Windows notification too. Maintenance now clears a merge's or an integration's journal whose job is done, cancelled, or deleted without a cancel and untouched for the history's days. Tests pin the matches jobs in the priority queue, the owner's defaults (ask always, union, copy across), the dialog starting from the settings, Choose each preselecting nothing, no automatic photos for a pair whose server copy is gone, the repair of a corrupt local frame by an Integrate, and the owner's whole scenario end to end against a real in-process server. Refs #73 Co-Authored-By: Claude Opus 5.5 --- docs/CHANGELOG.md | 6 + docs/DECISIONS.md | 3 + i18n/en/Tooltips.resx | 1 + i18n/it/Tooltips.it.resx | 1 + src/Chronos.App/Sections/SettingsViewModel.cs | 2 +- .../Server/Copies/CopyListViewModel.cs | 16 +- src/Chronos.App/Server/SyncHost.cs | 19 + src/Chronos.App/Server/SyncTableViewModel.cs | 35 +- src/Chronos.App/Server/SyncText.cs | 14 +- .../Archiving/ArchiveMaintenance.cs | 27 +- .../Server/CopyScreenSmokeTests.cs | 99 +++++ .../Chronos.App.Tests/Server/SyncTextTests.cs | 15 + .../Settings/SettingsLogicTests.cs | 30 ++ .../Copies/CopyJournalMaintenanceTests.cs | 76 ++++ .../Copies/IntegrateTests.cs | 40 ++ .../Chronos.Data.Tests/Sync/FakeSyncRemote.cs | 6 + .../Sync/SyncAgentCopyTests.cs | 32 ++ .../Sync/CopyScenarioTests.cs | 393 ++++++++++++++++++ 18 files changed, 804 insertions(+), 11 deletions(-) create mode 100644 tests/Chronos.Data.Tests/Copies/CopyJournalMaintenanceTests.cs create mode 100644 tests/Chronos.Server.Tests/Sync/CopyScenarioTests.cs diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 2cf2a26b..dd86948b 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -23,6 +23,12 @@ commits follow Conventional Commits (release notes are generated from them by `C - Drop… on Two versions trashes one version on both sides, after re-checking the other one. - A merge that keeps the pair's other sequence shows it in the first column and applies the choices to it. - Upload all reads every pair, not only the ones listed. + - New photos of an integrated pair that failed to move three times in a row are told ("photos not sent" · Show) and + their row reads "not sent" with the reason. + - The "matches found" and "sequences linked" toasts of a detection that ran by itself open the matches from their + Windows notification too. + - The maintenance pass clears the journal of a merge or an integration that ended without deleting it, or whose job + was deleted without a cancel and nothing wrote for as long as the job history keeps jobs. ## [1.1.1] — 2026-11-16 diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index 27c6efaf..79f7db76 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -907,3 +907,6 @@ One line per decision: date · decision · alternative · reason. | 2026-11-17 | A local copy's probe stores the server's newest update time it saw (`copy_probes.server_newest`, in migration 0012); a server sequence is due only when the server shows a newer one (to the microsecond) | Compare with this PC's clock | A server whose clock is behind would hide its new sequences | | 2026-11-17 | The photo lookup's sample also carries the hashed sample photos by size and capture time; the hit threshold counts each sampled photo once | Hashes only | A server that has not hashed its copy yet (adopted, not verified) lists no hash | | 2026-11-17 | In a merge keeping the pair's other sequence the dialog swaps its columns; detail index 0 stays "kept" and Different photos are re-keyed to the kept one's version | Keep the pair's order | The merge reads ThisPc and TakeHere as the kept side | +| 2026-11-17 | The maintenance pass clears a merge's or an integration's journal (`merge-.json`, `integrate-.json`) once its job is done or cancelled, or once the index no longer knows the job and nothing wrote the file for the job history's days; a failed or paused job's journal stays for its retry (#73) | Clear it with the job's deletion only | A job deleted without a cancel (or another host's) never deletes its journal itself | +| 2026-11-17 | Automatic photos that failed `SyncAgent.NotSentAfter` (3) times in a row are told once with an error toast "{title}: photos not sent" · Show, which runs from its Windows notification too and shows the row; the row reads "not sent", the last reason in its tooltip, until a transfer succeeds (#73) | A toast at every failure; a badge only | Design §6.1/§7.3: retried quietly with backoff, told when it keeps failing; a toast that only navigates may run from the notification, as the jobs' Open does | +| 2026-11-17 | A Corrupt or Missing frame on this PC whose photo the server holds is repaired by an Integrate through the ordinary fetch: the plan lists it as a Fetch (the comparison leaves unusable frames out), and the ingest replaces the damaged holder in place, the old file moved aside as `.damaged-