[Bug] Lock owned by another client (e.g. Text app) cannot be unlocked from the app
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Read FileLockingHelper.canUserUnlockFile() and trace how the overflow menu uses its result to show the unlock action. Compare the client check with the server rule described in the issue, including the caveat for group folders and external storage. Done when the file owner can unlock a file owned by them and the behavior is covered by a relevant test.
Written by the indexing model from the issue text.
Description
Steps to reproduce
- Open a Markdown/text file in the Text app (web or Android) and close it without releasing the lock (tab killed, connection lost, app swiped away).
files_lockkeeps the lock with ownertext.- Open that file's overflow menu in the Nextcloud Android app.
Actual behaviour
The file is shown as locked (lock icon, "Locked by Text app — expires in …"), but the menu has no "Unlock file" entry. FileLockingHelper.canUserUnlockFile() only returns true when lockOwnerId == userId, so the file owner is never offered the action.
With the default lock_timeout = -1 the lock never expires; edits then fail with ManuallyLockedException / HTTP 423 and are only recoverable from the web UI (or by waiting for a configured timeout).
Expected behaviour
The file owner can unlock. The server already allows this — OCA\FilesLock\Service\LockService::canUnlock():
if ($request->getType() === ILock::TYPE_USER && $isFileOwner) {
return;
}
Possible fix
Also accept the file owner in FileLockingHelper (file.ownerId == userId), mirroring the server check. I'm preparing a PR.
Caveat: for group folders and external storage the server deliberately skips the file-owner check, so the client cannot mirror the rule exactly there.
Environment
- Server: Nextcloud 34 (AIO),
files_lock34.0.1 - Client: current Play release
- File in personal storage
- Dominant language
- Kotlin
- Stars
- 5.6k
- Forks
- 2k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 92
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/android
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Modification time is not preserved when uploading MediaStore content via Android sharePossibly taken @alperozturk96 claimed this 25 days ago. Open3. to review bug feature: transfers
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
nextcloud/android#17675 · 4 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
0. Needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
nextcloud/android#17533 · 1 comment ·
Maintainers usually reply within 1 day
-
RC 34.1.0-01: Duplicated wording in creation menu — "New" prefix + creator name produces "New New document" ("Neu Neues Dokument")Possibly taken @ChristianTannheimer claimed this 91 days ago. Open0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
All issues in nextcloud/android
Similar issues
-
android bug kotlin vulkan
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
maplibre/maplibre-native-ffi#852 ·
Maintainers usually reply within 1 day
-
documentation importer size:S
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
enorm-labs/event-junkie#3614 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
InsertKoinIO/koin#2477 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
qiin2333/moonlight-vplus#742 ·
Maintainers usually reply within 1 day
-
[Submission] AI服务引擎Opensubmit-adaption submit-adaption-pre
Difficulty 1/5 Under an hour Newbie friendliness 76/100
BetterAndroid/android-notification-icon-project#783 · 1 comment ·
Maintainers usually reply within 1 day