fix(sync): tolerate existing WebDAV dirs after MKCOL auth errors#445
Open
codedogQBY wants to merge 1 commit into
Open
fix(sync): tolerate existing WebDAV dirs after MKCOL auth errors#445codedogQBY wants to merge 1 commit into
codedogQBY wants to merge 1 commit into
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.
Analysis
Issue #206 shows iPad WebDAV sync failing even though the same WebDAV account works on Android. The diagnostic log has a key pattern:
PROPFIND /succeeds with207, so credentials and the server URL are valid.MKCOL /readanyreturns401, which aborts directory setup.Some WebDAV servers are inconsistent around
MKCOLfor directories that already exist or are visible through the parent listing. Treating that response as a hard auth failure blocks sync even when the target collection is already present.Changes
MKCOLfails or returns401/403, re-check whether the collection already exists.PROPFIND Depth: 0check, and add a parent-directory listing fallback for servers that refuse direct collection probes but expose the child in the parent listing./readany/probe misses,MKCOL /readany/returns401, parent/listing includes/readany/, andensureDirectory()proceeds.Verification
pnpm --filter @readany/core test -- webdav-clientpnpm --filter @readany/core exec tsc --noEmitpnpm exec biome check packages/core/src/sync/webdav-client.ts packages/core/src/sync/webdav-client.test.tsgit diff --checkFixes #206