From 4673fb5fe4b85b8ed185a772dbef27b31b7568f2 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 3 Apr 2022 16:07:39 +1000 Subject: [PATCH] Colpkg import now marks collection as modified Addresses a corner case where a backup is imported into an unchanged collection, resulting in the sync indicator showing a full sync is required, which doesn't go away as syncing thinks no changes are required. An alternative way to solve this would be to reverse the order of checks in the syncing code. It would have the advantage of retaining the modification time of the backup, but any action like clicking on a deck would cause it to be updated anyway, so I'm not sure that buys us much. --- rslib/src/import_export/package/colpkg/import.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rslib/src/import_export/package/colpkg/import.rs b/rslib/src/import_export/package/colpkg/import.rs index bd6a6fe00..3cdffcba7 100644 --- a/rslib/src/import_export/package/colpkg/import.rs +++ b/rslib/src/import_export/package/colpkg/import.rs @@ -84,6 +84,7 @@ fn check_collection_and_mod_schema(col_path: &Path) -> Result<()> { .ok() .and_then(|mut col| { col.set_schema_modified().ok()?; + col.set_modified().ok()?; col.storage .db .pragma_query_value(None, "integrity_check", |row| row.get::<_, String>(0))