Skip to content

Fix: notification text for a lock timeout set to zero minutes - #10798

Open
DmySyz wants to merge 1 commit into
masterfrom
fix/lock-timeout-zero-minutes-notification
Open

DmySyz wants to merge 1 commit into
masterfrom
fix/lock-timeout-zero-minutes-notification

Conversation

@DmySyz

@DmySyz DmySyz commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Resolves

Summary

When "files_lock lock_timeout" parameter is set to “0,” the notification states that the file is locked indefinitely instead of saying that the file will be locked for "0 minutes".

Checklist

AI (if applicable)

Assisted-by: ClaudeCode:claude-sonnet-4-8

@DmySyz
DmySyz marked this pull request as draft September 10, 2026 21:32

@claucambra claucambra left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi, looks like maybe there was some issue when rebasing the branch or something along these lines, there is a humongous changeset in this PR

@DmySyz
DmySyz force-pushed the fix/lock-timeout-zero-minutes-notification branch from e7a0b4a to 9bd73c1 Compare September 15, 2026 13:30
@DmySyz

DmySyz commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Hi, looks like maybe there was some issue when rebasing the branch or something along these lines, there is a humongous changeset in this PR

Yep, not sure what happened - should be ok now.

@DmySyz
DmySyz requested a review from claucambra September 15, 2026 13:37
@DmySyz
DmySyz marked this pull request as ready for review September 16, 2026 07:42
@DmySyz
DmySyz force-pushed the fix/lock-timeout-zero-minutes-notification branch from 9bd73c1 to 0c2a0ff Compare September 16, 2026 07:42
@sonarqubecloud

Copy link
Copy Markdown

When files_lock is configured with lock_timeout = -1 (default, infinite)
or 0, the DAV nc:lock-timeout property returns a non-positive value.
fileLockTimeRemainingMinutes() would compute a past expiry time, yield a
negative remainingTime and return 0, causing the system tray notification
to say "Lock will last for 0 minutes."

Guard for lockTimeOut <= 0 and return -1 as a sentinel for "no expiry".
Both fileAlreadyLocked() and fileLockSuccess() now check the sentinel and
show "Lock has no expiry. You can unlock this file manually once you are
finished editing." instead.

Assisted-by: ClaudeCode:claude-sonnet-4-8
Signed-off-by: dsyzov <dmytro.syzov@nextcloud.com>
@DmySyz
DmySyz force-pushed the fix/lock-timeout-zero-minutes-notification branch from 0c2a0ff to 36d5d2b Compare September 16, 2026 10:06
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.

2 participants