Skip to content

fix: avoid double prefix when listing remote WebDAV directory - #1

Open
by-2020-github wants to merge 1 commit into
shonngithub:mainfrom
by-2020-github:fix-webdav-list-path
Open

fix: avoid double prefix when listing remote WebDAV directory#1
by-2020-github wants to merge 1 commit into
shonngithub:mainfrom
by-2020-github:fix-webdav-list-path

Conversation

@by-2020-github

Copy link
Copy Markdown

list(remotePath) always re-joined remotePath with baseRemotePath via
fullPath(). Callers pass cfg.webdav.remote_path (e.g. /Vol2_Home/codex),
which produced a doubled path (/Vol2_Home/codex/Vol2_Home/codex) and an
HTTP 404. The error was silently swallowed by .catch(() => []) in
api/sync.js and bin/cxsync.js, so the remote file list was always empty:
preview always showed 0 files to download, and every sync re-uploaded all
local files.

Now list() treats a path that is already baseRemotePath (or one of its
sub-paths) as absolute and uses it as-is; relative sub-paths still go
through fullPath().

list(remotePath) always re-joined remotePath with baseRemotePath via fullPath(). Callers pass cfg.webdav.remote_path (e.g. /Vol2_Home/codex), which produced a doubled path (/Vol2_Home/codex/Vol2_Home/codex) and an HTTP 404. The error was silently swallowed by .catch(() => []) in api/sync.js and bin/cxsync.js, so the remote file list was always empty: preview always showed 0 files to download, and every sync re-uploaded all local files.

Now list() treats a path that is already baseRemotePath (or one of its sub-paths) as absolute and uses it as-is; relative sub-paths still go through fullPath().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant