Skip to content

[stable35] fix(dav): report a lock that never expires as timeout 0, not -60 - #1285

Merged
benjaminfrueh merged 2 commits into
stable35from
backport/1271/stable35
Sep 8, 2026
Merged

benjaminfrueh merged 2 commits into
stable35from
backport/1271/stable35

Conversation

@backportbot

@backportbot backportbot Bot commented Sep 8, 2026

Copy link
Copy Markdown

Backport of PR #1271

The default configuration is `lock_timeout = -1` minutes, which the lock
service turns into a lifetime of -60 seconds. That value went out raw on
the `nc:lock-timeout` WebDAV property, and clients add it to `lock-time`
to work out when the lock expires. So a lock that never expires arrived
as one that expired a minute ago, and the Android client happily showed
"1 minute ago" next to a perfectly healthy lock.

0 is the value the clients already implement for "this lock does not
expire" (documented here since #175, and Android checks for exactly
that), so send that instead. The README had drifted to `-1`, which was
the config value, not the property value; put it back.

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
… Second--60

FileLock::toLockInfo() feeds the standard {DAV:}timeout property from the
same internal lifetime as nc:lock-timeout, so a lock that never expires
(-60 seconds internally under the default config) went out as
"Second--60". RFC4918 only allows "Second-<n>" or "Infinite" there, and
Sabre's LockDiscovery only renders "Infinite" for a timeout of exactly
Sabre\DAV\Locks\LockInfo::TIMEOUT_INFINITE (-1).

Map a non-positive internal timeout to that sentinel, mirroring how
LockPlugin::davTimeout() already handles the nc:lock-timeout property.

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
@benjaminfrueh
benjaminfrueh merged commit 364dbb8 into stable35 Sep 8, 2026
46 checks passed
@benjaminfrueh
benjaminfrueh deleted the backport/1271/stable35 branch September 8, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants