From e72cef6c5284328f2b1cff8890c20b035ab2ea46 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Tue, 15 Sep 2026 17:07:57 +0800 Subject: [PATCH] fix(database): synchronize cleanup of bookmarks and tab groups in orphan states MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cleanup could leave dangling references because bookmarks and tab groups were removed independently while ownership records were still being reconciled; the residue was re-persisted by later sync runs. 孤立状态下的书签与标签组独立清理时归属记录仍在协调,残留项会被 后续同步再次落盘。 Log: 修复孤立状态下书签与标签组清理不同步导致残留引用的问题 Influence: 数据库书签与标签组清理逻辑,孤立状态下不再残留悬挂引用。 --- reader/app/Database.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reader/app/Database.cpp b/reader/app/Database.cpp index b37190027..53823fb2e 100644 --- a/reader/app/Database.cpp +++ b/reader/app/Database.cpp @@ -794,10 +794,13 @@ int Database::cleanupOrphanStates() cleanedCount++; qCDebug(appLog) << "Cleaned orphan state:" << path; } - // 同步清理书签(在同一事务中保证数据一致性) + // 同步清理书签与标签页组(在同一事务中保证数据一致性) deleteQuery.prepare("DELETE FROM bookmark WHERE filePath = :filePath"); deleteQuery.bindValue(":filePath", path); deleteQuery.exec(); + deleteQuery.prepare("DELETE FROM tabgroup WHERE filePath = :filePath"); + deleteQuery.bindValue(":filePath", path); + deleteQuery.exec(); } transaction.commit();