From c59a852b8dff248fa0090dcd8d748253c46d9293 Mon Sep 17 00:00:00 2001 From: InfinityPacer <160988576+InfinityPacer@users.noreply.github.com> Date: Fri, 21 Aug 2026 19:09:33 +0800 Subject: [PATCH] fix(plugins): preserve top-level hidden restore entries (#6378) --- app/chain/system.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/chain/system.py b/app/chain/system.py index 7c072af6a..3198ddf07 100644 --- a/app/chain/system.py +++ b/app/chain/system.py @@ -165,7 +165,7 @@ class SystemChain(ChainBase): for item in backup_dir.iterdir(): if ( item.name == SystemChain._plugin_restore_pending_file - or item.name.startswith(".") + or SystemChain.__is_snapshot_artifact(item.name) ): continue target_path = plugins_dir / item.name @@ -205,6 +205,11 @@ class SystemChain(ChainBase): if backup_dir.exists(): SystemChain.__write_plugin_restore_pending(pending_file, {}) + @staticmethod + def __is_snapshot_artifact(name: str) -> bool: + """识别快照替换过程中生成的临时或旧快照条目。""" + return bool(re.fullmatch(r"\..+\.(?:tmp|old)-[0-9a-f]{32}", name)) + @staticmethod def __read_plugin_restore_pending(pending_file: Path) -> Optional[dict[str, bool]]: """读取仍需恢复的插件项目;无效内容按全部项目重试。"""