From 698f130ffaa0f5fa8aab2cf0756b10729bf29a51 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 12 Feb 2023 00:07:20 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=96=87=E6=A1=A3=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E4=B8=8D=E7=AC=A6=E5=90=88=20ID=20?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E6=97=B6=E8=87=AA=E5=8A=A8=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E5=88=B0=20corrupted=20=E6=96=87=E4=BB=B6=E5=A4=B9=E4=B8=8B=20?= =?UTF-8?q?Fix=20https://github.com/siyuan-note/siyuan/issues/7343?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/index_fix.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/model/index_fix.go b/kernel/model/index_fix.go index f31fc4327..a01c4feeb 100644 --- a/kernel/model/index_fix.go +++ b/kernel/model/index_fix.go @@ -128,6 +128,12 @@ func resetDuplicateTrees() { duplicatedPaths := map[string]string{} for p, absPath := range paths { name := path.Base(p) + if !ast.IsNodeIDPattern(strings.TrimSuffix(name, ".sy")) { + logging.LogWarnf("invalid .sy file name [%s]", p) + box.moveCorruptedData(absPath) + continue + } + if !names[name] { names[name] = true continue