🐛 WebDAV verify 移除写探针,修复坚果云同步失败 (#1444)#1445
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist / 检查清单
Description / 描述
close #1444
问题
Beta 1.4.0.1300 中坚果云(jianguoyun)WebDAV 同步失败:
https://dav.jianguoyun.com/dav/→ 备份/同步直接失败https://dav.jianguoyun.com/dav/ScriptCat能跑,但会在已有的ScriptCat/下再嵌套创建ScriptCat/ScriptCat/根因
#1395 (commit 27006fe) 把
WebDAV.verify()从单纯的getQuota()扩展为「列目录 + 在basePath写探针.scriptcat-verify-${Date.now()}-${Math.random().toString(36).slice(2)}+ 清理」。坚果云对 WebDAV 文件/目录名有长度限制,会以
sandbox name is too long拒绝这个探针目录名(.scriptcat-verify-+ 13 位时间戳 +-+ 11 位随机串 ≈ 43 字符),导致FileSystemFactory.create阶段 verify 就抛错,整个备份流程中断。第二种 URL 之所以"看起来能用",是 webdav client 的 base URL 已经指向
ScriptCat/,但紧跟着synchronize.ts:292又会createDir("ScriptCat") + openDir("ScriptCat"),于是嵌套出了/ScriptCat/ScriptCat。修复
回退 verify 到只读校验:保留
getQuota()+getDirectoryContents(basePath),移除createDirectory/putFileContents/deleteFile写探针。理由:
basePath写一个通用探针是脆弱设计。backupToCloud/buildFileSystem紧接着会调用createDir("ScriptCat"),权限/配额问题会在那里立即抛错,最多延后一两个 RTT。.scriptcat-verify-*垃圾,体验不好。参见 #1395 下的回复。
Screenshots / 截图
无 UI 变更。
Test plan
pnpm test -- --run packages/filesystem/webdav/webdav.test.ts全部通过(19/19)pnpm run typecheck通过https://dav.jianguoyun.com/dav/,备份后只生成/ScriptCat