fix: throw UnknownNotificationException for unknown notifications - #149
Merged
Merged
Conversation
Notifier::prepare() threw \InvalidArgumentException for a notification it does not know, both for another app's notification and for an unknown subject of its own. Since Nextcloud 30 the server logs a deprecation warning for every such call, so an instance with this app enabled wrote one line per notification any other app sent. UnknownNotificationException extends \InvalidArgumentException and has existed since Nextcloud 30, below the app's min-version of 33, so callers catching the old type are unaffected. Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
oleksandr-nc
deleted the
fix/notifier-unknown-notification-exception
branch
September 14, 2026 09:21
oleksandr-nc
added a commit
that referenced
this pull request
Sep 15, 2026
The notifier throws UnknownNotificationException since #149. It extends InvalidArgumentException, so these assertions kept passing after the merge, but they would also pass if the notifier went back to the deprecated exception. Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
oleksandr-nc
added a commit
that referenced
this pull request
Sep 22, 2026
The notifier throws UnknownNotificationException since #149. It extends InvalidArgumentException, so these assertions kept passing after the merge, but they would also pass if the notifier went back to the deprecated exception. Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notifier::prepare()throws\InvalidArgumentExceptionto signal a notification it does not know — both another app's notification and an unknown subject of its own. Since Nextcloud 30 the server treats that as deprecated and logs a warning for every such call:Every registered notifier is asked to prepare every notification, so an instance with this app enabled writes one of these lines for each notification any other app sends.
Both throws now use
OCP\Notification\UnknownNotificationException. It extends\InvalidArgumentExceptionand has existed since Nextcloud 30, below this app'smin-versionof 33, so callers catching the old type are unaffected.Same change as nextcloud/integration_jira#162, nextcloud/integration_github#202 and nextcloud/integration_openai#376.
🤖 AI (if applicable)