Skip to content

Add OCM Notification Received Event#61201

Open
mickenordin wants to merge 2 commits into
masterfrom
kano-ocm-notification-event
Open

Add OCM Notification Received Event#61201
mickenordin wants to merge 2 commits into
masterfrom
kano-ocm-notification-event

Conversation

@mickenordin

Copy link
Copy Markdown
Contributor

Summary

OCM is standardizing and expanding the use of notifications and having an event for acting on in apps will be very useful. The immediate use-case will be for an app the implements the proposed federated group sprecification in OCM that relies heavily on notifications.

Checklist

I will make a separate pr to nextcloud-documentation when and if this pr is accepted.

AI

I made an AI double check my test case, and made modifications after, but I wrote the code my self.

@mickenordin mickenordin added this to the Nextcloud 35 milestone Jun 11, 2026
@mickenordin mickenordin requested review from a team and nickvergessen as code owners June 11, 2026 10:24
@mickenordin mickenordin added enhancement 3. to review Waiting for reviews labels Jun 11, 2026
@mickenordin mickenordin requested review from CarlSchwan, leftybournes, provokateurin and salmart-dev and removed request for a team June 11, 2026 10:25
@mickenordin mickenordin force-pushed the kano-ocm-notification-event branch from e90ae9d to ea274d3 Compare June 11, 2026 10:37
$notificationEvent = new OCMNotificationReceivedEvent($notificationObject);
$this->dispatcher->dispatchTyped($notificationEvent);
} catch (\Exception $e) {
$this->logger->warning('error while dispatching OCM notification received event', ['exception' => $e]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the expected error? the code doesn't look very dangerous

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking is that this runs at the very end of the function, where everything has been successful so far. If one of the listeners fail, that problem could bubble up and cause an issue for something that has already been successful for all intents and purposes. Am I wrong in that assumption? Should I remove the try/catch?

@susnux susnux added the community pull requests from community label Jun 11, 2026
OCM is standardizing and expanding the use of notifications and having
an event for acting on in apps will be very useful.

Signed-off-by: Micke Nordin <kano@sunet.se>
Signed-off-by: Micke Nordin <kano@sunet.se>
@mickenordin mickenordin force-pushed the kano-ocm-notification-event branch from ea274d3 to bac20d8 Compare June 12, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews community pull requests from community enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants