From 3c2c33b35cabfcb61a9e692cec0fb07125b88a70 Mon Sep 17 00:00:00 2001 From: Jeffrey Chen <78434827+TCOTC@users.noreply.github.com> Date: Wed, 11 Feb 2026 19:20:58 +0800 Subject: [PATCH] :bug: Kernel crash when WPS opens Excel asset https://github.com/siyuan-note/siyuan/issues/17010 (#17011) --- kernel/model/assets.go | 12 ++++++++---- kernel/model/assets_watcher.go | 5 ----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/kernel/model/assets.go b/kernel/model/assets.go index 0a986eb2e..1b35dc621 100644 --- a/kernel/model/assets.go +++ b/kernel/model/assets.go @@ -86,8 +86,10 @@ func HandleAssetsRemoveEvent(assetAbsPath string) { if !filelock.IsExist(assetAbsPath) { return } - - if ".DS_Store" == filepath.Base(assetAbsPath) { + if gulu.File.IsDir(assetAbsPath) { + return + } + if filelock.IsHidden(assetAbsPath) { return } @@ -106,8 +108,10 @@ func HandleAssetsChangeEvent(assetAbsPath string) { if !filelock.IsExist(assetAbsPath) { return } - - if ".DS_Store" == filepath.Base(assetAbsPath) { + if gulu.File.IsDir(assetAbsPath) { + return + } + if filelock.IsHidden(assetAbsPath) { return } diff --git a/kernel/model/assets_watcher.go b/kernel/model/assets_watcher.go index 69e115b5e..8adff63e5 100644 --- a/kernel/model/assets_watcher.go +++ b/kernel/model/assets_watcher.go @@ -21,7 +21,6 @@ package model import ( "os" "path/filepath" - "strings" "time" "github.com/88250/gulu" @@ -72,10 +71,6 @@ func watchAssets() { return } - if strings.HasSuffix(event.Name, ".tmp") { - continue - } - lastEvent = event timer.Reset(time.Millisecond * 100) case err, ok := <-assetsWatcher.Errors: