Skip to content

fix: token retry, 115 decrypt retry, webdav lockroot, local cross-device recycle - #57

Merged
AlliotTech merged 4 commits into
mainfrom
fix/robustness-batch-4
Dec 1, 2026
Merged

AlliotTech merged 4 commits into
mainfrom
fix/robustness-batch-4

Conversation

@AlliotTech

Copy link
Copy Markdown
Owner

Four small robustness fixes, one commit each:

  • fix(onedrive): retry token refresh only once — Request() recursed unconditionally when the server kept rejecting the token with InvalidAuthenticationToken, even after a successful refresh. Now a refreshed token is tried exactly once. Same fix in onedrive_app.
  • fix(115): retry rapid upload init on decrypt failure — rapidUpload() retries the init request up to 3 times on ECDH decrypt failure, and closes the response body promptly instead of deferring it inside the retry loop.
  • fix(webdav): return request URL as LOCK lockroot — handleLock() wrote the internal storage path into the lockroot href; now mapped back to the URL path the client sees. Adds TestLockRootHref.
  • fix(local): fall back to copy when recycle-bin move crosses devices — Remove() used a bare os.Rename(); on a cross-device error it now copies with copyForMove() (preserves symlinks, named pipes, modtimes) and removes the source, cleaning up partial copies. Adds per-platform isCrossDeviceError() helpers and copyForMove tests.

Verified: gofmt clean, go vet clean, go build passes for all touched packages (including GOOS=windows for drivers/local), go test passes for drivers/local and server/webdav.

Request() recursed unconditionally when the server kept rejecting the token with InvalidAuthenticationToken, even after a successful refresh. Split the public Request() into a wrapper and a private request() carrying a retried flag, so a refreshed token is tried exactly once and a still-invalid token returns its error instead of recursing forever. Same fix in onedrive_app, which had the identical loop.
rapidUpload() gave up on the first ECDH decrypt failure of the upload-init response. Retry the init request up to 3 times on decrypt failure. Also close the response body promptly instead of deferring it inside the retry loop.
handleLock() wrote the internal storage path into the lockroot href of the LOCK response. Map the storage path back to the URL path the client sees with lockRootHref(), like the hrefs PROPFIND writes. Add TestLockRootHref.
Remove() moved files to the recycle bin with a bare os.Rename(), which fails when the recycle bin lives on another device. On a cross-device error, copy the file or tree with copyForMove() (preserves symlinks, named pipes and modtimes) and remove the source, cleaning up a partial copy on failure. Add per-platform isCrossDeviceError() helpers and copyForMove tests.
@AlliotTech
AlliotTech merged commit 71133ba into main Dec 1, 2026
6 checks passed
@AlliotTech
AlliotTech deleted the fix/robustness-batch-4 branch December 1, 2026 07:10
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