From 78df4211b0f5012bcbb66bacfd7786b995853870 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sat, 26 Sep 2026 17:50:38 -0400 Subject: [PATCH] Run the people deduplication after every catalog merge (#78) A merge is where two devices' people meet: the same name typed on each, or a redirect one of them made. So dedup_people::run now follows every successful sync::merge_remote. It runs on the sync worker, never the UI thread, before the snapshot is pushed, so what it folds reaches the server on the same pass. It runs in its own transaction, and a failure is logged, not returned. What the merge took is committed and valid either way, and the next pass tries again. Once a catalog is clean it costs 8-15 ms on the reference library (19k faces, 26k people rows). On copies of the two real catalogs, a round trip with a peer running the previous merge converges on 75 listed named people on both sides and stays there over a second round. merge_remote with the job takes 75-90 ms there. --- core/dr-catalog/src/sync.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/dr-catalog/src/sync.rs b/core/dr-catalog/src/sync.rs index 59dc80a..32ee48f 100644 --- a/core/dr-catalog/src/sync.rs +++ b/core/dr-catalog/src/sync.rs @@ -344,6 +344,18 @@ pub fn merge_remote(conn: &Connection, remote: &Path) -> Result