From a60f9494ec328f3202fe587ea247caac8faaaf97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 17 Nov 2025 17:30:46 +0100 Subject: [PATCH 1/2] fix(files_sharing): Allow deleting a share of a missing file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This can happen in various scenarios, we should allow the user to delete the share in this situation. Signed-off-by: Côme Chilliet --- apps/files_sharing/lib/Controller/ShareAPIController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index fb8a702cbd4d1..0c7325d096fae 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -545,6 +545,8 @@ public function deleteShare(string $id): DataResponse { $this->lock($share->getNode()); } catch (LockedException $e) { throw new OCSNotFoundException($this->l->t('Could not delete share')); + } catch (NotFoundException $e) { + $this->logger->debug('File of deleted share was not found, skip locking', ['exception' => $e]); } if (!$this->canAccessShare($share)) { From cc66d203d4535f5d353b18a389a96c93bd118133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <91878298+come-nc@users.noreply.github.com> Date: Tue, 18 Nov 2025 11:03:03 +0100 Subject: [PATCH 2/2] chore: Improve wording in debug log MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com> --- apps/files_sharing/lib/Controller/ShareAPIController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 0c7325d096fae..f4d1bc91a7b75 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -546,7 +546,7 @@ public function deleteShare(string $id): DataResponse { } catch (LockedException $e) { throw new OCSNotFoundException($this->l->t('Could not delete share')); } catch (NotFoundException $e) { - $this->logger->debug('File of deleted share was not found, skip locking', ['exception' => $e]); + $this->logger->debug('File of to be deleted share was not found, skip locking', ['exception' => $e]); } if (!$this->canAccessShare($share)) {