Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(locks): only lock when editing
Read only shares should not lock a document.

Prevent file sync conflicts when nobody is editing.

See #5862.

Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud authored and backportbot[bot] committed Jun 7, 2024
commit 68d26cc8a41c4713fc22e98402dd47f8e699779c
8 changes: 5 additions & 3 deletions lib/Service/ApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,11 @@ public function create(?int $fileId = null, ?string $filePath = null, ?string $b
$lockInfo = null;
}

$isLocked = $this->documentService->lock($file->getId());
if (!$isLocked) {
$readOnly = true;
if (!$readOnly) {
$isLocked = $this->documentService->lock($file->getId());
if (!$isLocked) {
$readOnly = true;
}
}

return new DataResponse([
Expand Down