Skip to content

fix(dav): extend the lock expiry on a WebDAV LOCK refresh - #1361

Merged
benjaminfrueh merged 1 commit into
nextcloud:mainfrom
gazziiii777:fix/dav-lock-refresh-expiry
Oct 15, 2026
Merged

benjaminfrueh merged 1 commit into
nextcloud:mainfrom
gazziiii777:fix/dav-lock-refresh-expiry

Conversation

@gazziiii777

@gazziiii777 gazziiii777 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

A refresh wrote the client's Timeout from the original LOCK instead of from the refresh, so a native WebDAV lock died after the first Timeout regardless of refreshes and every later PUT got 412. Add the elapsed time to the stored lifetime so the expiry moves out from the refresh.

Fixes #1343

AI disclosure: this PR was prepared with Claude Code (claude-fable-5-1). It found the cause in the code and wrote the fix and the test. I ran into the bug with users on my own Nextcloud server, applied the fix there and verified that saving from Excel over WebDAV no longer fails after an hour. The commit carries the Assisted-by trailer.

@benjaminfrueh benjaminfrueh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for opening this PR! Seems good to me, I left a small review.

Also in case this PR was AI assisted, please add the Assisted-by: AGENT_NAME:MODEL_VERSION trailer to the commit and disclose it in the PR description as described in our AI policy https://github.com/nextcloud/.github/blob/master/AI_POLICY.md

* there produced the invalid "Second--60"; -60 and 0 are what
* LockService::lock() actually stores for the two "never expires" configs.
*/
/**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new test is inserted between testInfiniteLockReportsStandardWebdavTimeoutAsInfinite() and its docblock. Could you move it above line 359?

@benjaminfrueh benjaminfrueh added bug Something isn't working 3. to review labels Oct 15, 2026
A refresh wrote the client's Timeout from the original LOCK instead of from the refresh, so a native WebDAV lock died after the first Timeout regardless of refreshes and every later PUT got 412. Add the elapsed time to the stored lifetime so the expiry moves out from the refresh.

Fixes nextcloud#1343

Assisted-by: Claude Code:claude-fable-5-1
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: gazziiii777 <gazziiii777@gmail.com>
@gazziiii777
gazziiii777 force-pushed the fix/dav-lock-refresh-expiry branch from 9e8b256 to 0012f64 Compare October 15, 2026 09:14
@benjaminfrueh

Copy link
Copy Markdown
Contributor

/backport to stable35

@benjaminfrueh

Copy link
Copy Markdown
Contributor

/backport to stable34

@benjaminfrueh
benjaminfrueh merged commit 7fbe2c1 into nextcloud:main Oct 15, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lock Refresh Failure with Microsoft-WebDAV-MiniRedir

2 participants