From a4178e54b622d2038b10ae47bd678ab895d30aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ko=C5=88a=C5=99=C3=ADk?= Date: Fri, 9 Jan 2026 18:42:21 +0100 Subject: [PATCH] Re-read MerginProject state on creation/reuse --- dbsync.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dbsync.py b/dbsync.py index d36fd6a..1e11654 100644 --- a/dbsync.py +++ b/dbsync.py @@ -536,6 +536,10 @@ def _get_mergin_project(work_path) -> MerginProject: """ if work_path not in cached_mergin_project_objects: cached_mergin_project_objects[work_path] = MerginProject(work_path) + # Clear metadata so we re-read the state. + # This is needed since otherwise we can have multiple MerginProject + # instances of the same workpath with different state. + cached_mergin_project_objects[work_path]._metadata = None cached_mergin_project_objects[work_path]._read_metadata() return cached_mergin_project_objects[work_path]