Repository navigation
Show unlock action for the file owner - #17838
Open
falkloewert wants to merge 1 commit into
Open
falkloewert wants to merge 1 commit into
falkloewert wants to merge 1 commit into
Conversation
The server allows the owner of a file to unlock TYPE_USER locks (LockService::canUnlock), so a stale lock created by another client - e.g. the Text app, whose locks have the owner "text" - can be released by the user. The client only offered the action when the lock owner matched the current user, leaving users without a way to clear such locks until the lock timeout expires (which defaults to unlimited). Signed-off-by: Falk Loewert <falk@co-sinus.de>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #17837
Summary
The "Unlock file" entry was only shown when the current user owns the lock (
lockOwnerId == userId). The server also allows the file owner to unlockTYPE_USERlocks —OCA\FilesLock\Service\LockService::canUnlock():Without this, a stale lock created by another client (e.g. the Text app, lock owner
text) cannot be released from the app at all; with the defaultlock_timeout = -1it never expires.Change:
FileLockingHelper.canUserUnlockFile()now also acceptsfile.ownerId == userId.Known limitation: for group folders and external storage the server deliberately skips the file-owner check (
MountProviderallowlist incanUnlock), so the client cannot mirror the rule exactly there; the action can then fail with the existing error snackbar.🖼️ Screenshots
Not applicable — the only visible difference is an additional entry in the file overflow menu.
🏁 Checklist
FileLockingHelperTest, 5 tests)🤖 AI (if applicable)