From 387a41a4f1446da67a7877f50c5e916163b5f764 Mon Sep 17 00:00:00 2001 From: tide-wait Date: Mon, 25 May 2026 09:33:48 +0800 Subject: [PATCH 1/3] fix(op): apply Temp mask to all Copy/Move cache entries When a driver implementing CopyResult returns the source object instead of the actual new copy (e.g. 115_open), the directory cache was populated without a Temp mask. Subsequent Rename operations using excludeTempObj=true would hit the stale cache entry carrying the source file ID, causing the rename to target the source file instead of the copy. This ensures all post-copy and post-move cache entries carry the Temp flag, allowing Rename and Move to correctly trigger a fresh list via the existing excludeTempObj mechanism. --- internal/op/fs.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/op/fs.go b/internal/op/fs.go index f7b1c45b5..0f515af57 100644 --- a/internal/op/fs.go +++ b/internal/op/fs.go @@ -426,10 +426,11 @@ func Move(ctx context.Context, storage driver.Driver, srcPath, dstDirPath string } if cache, exist := Cache.dirCache.Get(dstKey); exist { if newObj == nil { - newObj = &model.ObjWrapMask{Obj: srcRawObj, Mask: model.Temp} + newObj = srcRawObj } else { newObj = wrapObjName(storage, newObj) } + newObj = &model.ObjWrapMask{Obj: newObj, Mask: model.Temp} cache.UpdateObject(srcRawObj.GetName(), newObj) } } @@ -551,10 +552,11 @@ func Copy(ctx context.Context, storage driver.Driver, srcPath, dstDirPath string if !storage.Config().NoCache { if cache, exist := Cache.dirCache.Get(dstKey); exist { if newObj == nil { - newObj = &model.ObjWrapMask{Obj: srcRawObj, Mask: model.Temp} + newObj = srcRawObj } else { newObj = wrapObjName(storage, newObj) } + newObj = &model.ObjWrapMask{Obj: newObj, Mask: model.Temp} cache.UpdateObject(srcRawObj.GetName(), newObj) } } From 7e4495d97cc673c5c55161378764d457646c70fd Mon Sep 17 00:00:00 2001 From: tide-wait Date: Mon, 25 May 2026 09:33:54 +0800 Subject: [PATCH 2/3] fix(115_open): handle GetFolderInfoByPath response format change The 115 Open API endpoint folder/get_info now returns the data field as a JSON array instead of a single object. The SDK (115-sdk-go v0.2.3) still unmarshals into a single struct, causing a "cannot unmarshal array" error. Catch this error in the driver Get method and return errs.NotSupport, which causes the upper-level op.Get to fall back to listing the parent directory to resolve the target object. --- drivers/115_open/driver.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/115_open/driver.go b/drivers/115_open/driver.go index 278ae0f7f..4933c1390 100644 --- a/drivers/115_open/driver.go +++ b/drivers/115_open/driver.go @@ -14,6 +14,7 @@ import ( "github.com/OpenListTeam/OpenList/v4/cmd/flags" "github.com/OpenListTeam/OpenList/v4/drivers/base" "github.com/OpenListTeam/OpenList/v4/internal/driver" + "github.com/OpenListTeam/OpenList/v4/internal/errs" "github.com/OpenListTeam/OpenList/v4/internal/model" "github.com/OpenListTeam/OpenList/v4/internal/op" "github.com/OpenListTeam/OpenList/v4/internal/stream" @@ -169,6 +170,9 @@ func (d *Open115) Get(ctx context.Context, path string) (model.Obj, error) { path = stdpath.Join(d.parentPath, path) resp, err := d.client.GetFolderInfoByPath(ctx, path) if err != nil { + if strings.Contains(err.Error(), "cannot unmarshal array") { + return nil, errs.NotSupport + } return nil, err } return &Obj{ From 050bb5bb053b439538436a49e5e457e836e27c8c Mon Sep 17 00:00:00 2001 From: tide-wait Date: Mon, 25 May 2026 21:00:26 +0800 Subject: [PATCH 3/3] style: go fmt --- drivers/115_open/driver.go | 2 +- drivers/115_open/types.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/115_open/driver.go b/drivers/115_open/driver.go index 4933c1390..b7632f761 100644 --- a/drivers/115_open/driver.go +++ b/drivers/115_open/driver.go @@ -222,7 +222,7 @@ func (d *Open115) Rename(ctx context.Context, srcObj model.Obj, newName string) return nil, err } _, err := d.client.UpdateFile(ctx, &sdk.UpdateFileReq{ - FileID: srcObj.GetID(), + FileID: srcObj.GetID(), FileName: newName, }) if err != nil { diff --git a/drivers/115_open/types.go b/drivers/115_open/types.go index 0bd95bfd1..493772a58 100644 --- a/drivers/115_open/types.go +++ b/drivers/115_open/types.go @@ -3,9 +3,9 @@ package _115_open import ( "time" + sdk "github.com/OpenListTeam/115-sdk-go" "github.com/OpenListTeam/OpenList/v4/internal/model" "github.com/OpenListTeam/OpenList/v4/pkg/utils" - sdk "github.com/OpenListTeam/115-sdk-go" ) type Obj sdk.GetFilesResp_File