Merge pull request #39689 from nextcloud/bugfix/39135/remove-share-notifications-for-deleted-nodes

fix(notifications): Remove share notification when the node is deleted
pull/39694/head
Joas Schilling 2023-08-04 09:39:24 +07:00 committed by GitHub
commit f8bd676154
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

@ -29,6 +29,7 @@ declare(strict_types=1);
namespace OCA\Files_Sharing\Notification;
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\IURLGenerator;
@ -117,6 +118,13 @@ class Notifier implements INotifier {
throw new AlreadyProcessedException();
}
try {
$share->getNode();
} catch (NotFoundException $e) {
// Node is already deleted, so discard the notification
throw new AlreadyProcessedException();
}
if ($notification->getSubject() === 'expiresTomorrow') {
$notification = $this->parseShareExpiration($share, $notification, $l);
} else {