From 3898bb8bcc9c0f612b68719039d4d42fb86828d7 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Wed, 26 Feb 2025 14:19:11 -0800 Subject: [PATCH] fix(files_reminders): Do not attempt to send reminders after a user has left a share Signed-off-by: Christopher Ng --- apps/files_reminders/lib/Notification/Notifier.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/files_reminders/lib/Notification/Notifier.php b/apps/files_reminders/lib/Notification/Notifier.php index 000b04119cd01..565ef9a469558 100644 --- a/apps/files_reminders/lib/Notification/Notifier.php +++ b/apps/files_reminders/lib/Notification/Notifier.php @@ -14,6 +14,7 @@ use OCP\Files\IRootFolder; use OCP\IURLGenerator; use OCP\L10N\IFactory; +use OCP\Notification\AlreadyProcessedException; use OCP\Notification\IAction; use OCP\Notification\INotification; use OCP\Notification\INotifier; @@ -51,8 +52,8 @@ public function prepare(INotification $notification, string $languageCode): INot $fileId = $params['fileId']; $node = $this->root->getUserFolder($notification->getUser())->getFirstNodeById($fileId); - if (!$node) { - throw new UnknownNotificationException(); + if ($node === null) { + throw new AlreadyProcessedException(); } $path = rtrim($node->getPath(), '/');