From 97ddc1c9e1affbbf65c47d205240c7c7bacf3c1a 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 a397dc3785a..c665653a67b 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -543,6 +543,8 @@ class ShareAPIController extends OCSController { $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 6cdac077a4589f96a103435ebf9ec9d122c5ddcb 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 c665653a67b..022e33d6783 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -544,7 +544,7 @@ class ShareAPIController extends OCSController { } 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)) {