Skip to content

Conversation

@Khoray
Copy link

@Khoray Khoray commented Jan 21, 2026

Description / 描述

把 listLibraries 的逻辑回退到 v4.1.8,即先判断当前目录是否是 d.RootFolderPath,是就需要执行 d.listLibraries()。

Motivation and Context / 背景

现在的 seafile 如果根目录不是 /,会导致进入目录显示 failed get objs: failed to list objs: object not found。原因是 这个commit 导致根目录不是 / 的时候不会执行 d.listLibraries(),导致 d.libraryMap 是空的。至少需要执行一次 d.listLibraries() 来保证 d.getRepoAndPath(path) 返回的是正确的。

Close #2011

How Has This Been Tested? / 测试

直接打开 seafile 驱动的目录查看。

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code with go fmt or prettier.
    我已使用 go fmtprettier 格式化提交的代码。
  • I have added appropriate labels to this PR (or mentioned needed labels in the description if lacking permissions).
    我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
  • I have requested review from relevant code authors using the "Request review" feature when applicable.
    我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
  • I have updated the repository accordingly (If it’s needed).
    我已相应更新了相关仓库(若适用)。

@xrgzs xrgzs changed the title fix(driver/seafile): object not found when RootFolderPath != "/" fix(drivers/seafile): object not found when RootFolderPath != "/" Jan 22, 2026
@xrgzs xrgzs added bug Module: Driver Driver-Related Issue/PR labels Jan 22, 2026
@xrgzs xrgzs requested a review from j2rong4cn January 22, 2026 01:29
@jyxjjj jyxjjj requested a review from Copilot January 22, 2026 03:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request attempts to fix an "object not found" error that occurs when the Seafile driver's RootFolderPath is set to something other than "/". The fix ensures that listLibraries() is called to populate the libraryMap before it's used by getRepoAndPath().

Changes:

  • Modified the List() function to check if the path equals RootFolderPath (instead of only checking if path equals "/")
  • Nested the library list return logic to still check for both path == "/" and d.RepoId == ""
  • Ensures libraryMap is populated when accessing the root path, regardless of RootFolderPath configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@j2rong4cn
Copy link
Member

我不用seafile,麻烦测试一下

@Khoray
Copy link
Author

Khoray commented Jan 22, 2026

我不用seafile,麻烦测试一下

这样不行,逻辑应该比如传进来的 dir=/aaa/bbb/ccc,这个 aaa 是 repo,需要先转成 repo_id,然后传给 /api2/repos/<repo_id>/dir?p=bbb%2fccc,所以还是要 libraryMap 的

@j2rong4cn
Copy link
Member

你测试了吗

@Khoray
Copy link
Author

Khoray commented Jan 22, 2026

你测试了吗

试过了,failed get objs: failed to list objs: request failed

@j2rong4cn
Copy link
Member

拉取最新的再试试,应该没问题了

@Khoray
Copy link
Author

Khoray commented Jan 22, 2026

拉取最新的再试试,应该没问题了

现在四种情况都没问题了(repoid=/!="",rootpath=/!="/")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Module: Driver Driver-Related Issue/PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 【驱动异常】Seafile驱动对接无效

4 participants