mirror of
https://github.com/codexu/note-gen.git
synced 2026-04-25 12:55:57 +03:00
[GH-ISSUE #207] [bug] Webdav使用InfiniCLOUD存在的问题 #159
Labels
No labels
bug
duplicate
feature
platform: Android
platform: Linux
platform: Windows
platform: iOS
platform: macOS
priority: high
priority: low
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/note-gen#159
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wha4up on GitHub (May 21, 2025).
Original GitHub issue: https://github.com/codexu/note-gen/issues/207
详细描述这个 Bug
问题1:
使用InfiniCLOUD成功备份后,会在InfiniCLOUD按备份路径名逐字生成文件夹,直到生成全名后将文件备份到最后的文件夹。
问题2:
即使已经成功(目的达成,效果有待提高)在InfiniCLOUD备份,但Webdav检测依然显示不可用。
NoteGen 版本
0.16.3
操作系统
Windows
报错日志
没有。
@oclld commented on GitHub (Jun 23, 2025):
@wha4up commented on GitHub (Jun 24, 2025):
我以前在其他应用上用webdav备份也碰到过同样的问题,估计是使用了相同的方式
@Lovi-github commented on GitHub (Jul 16, 2025):
同样是遇到了这样的问题
@zlnox commented on GitHub (Jul 21, 2025):
你遇到的问题是:WebDAV 路径输入框每输入一个字符,WebDAV 服务器目录下就新建了一个以该字符命名的文件夹,导致路径里每一个字符都被当成文件夹创建了!
这个问题其实是无意中反复调用了
webdav_test,并且webdav_test里的自动建目录的逻辑被每一轮输入都触发了。现象的根源
前端:
你的每个 setter(如
setPath)都自动调用了testConnection:每输入一个字符,都会
setPath,都会testConnection。后端:
testConnection其实会调用 webdav_test,而 webdav_test 逻辑如下:问题详细说明:
test_path分别是 "a"、"ab"、"abc"彻底解决思路
1. 不要每输入一次就测试/新建目录
testConnection。2. webdav_test 逻辑改进:不自动新建目录
推荐代码调整
A. 前端(防抖 + 不自动每字符触发)
或者更优方式,你在路径输入框加一个“测试按钮”:
B. 后端(test 只测试不新建)
将
webdav_test写成这样:真正需要自动创建目录时,比如用户首次同步数据,再判断 mkdir。
小结
你可以这样理解:
只要按上面修改,服务器就不会再无脑地每输入一个字符新建一个目录了!
如需更详细代码示例可再提问!