Page MenuHomePhabricator

Allow Echo to handle generic notifications
Closed, ResolvedPublic

Description

Echo Event handling is limited to know events only - see

if ( !isset( $wgEchoNotifications[$info['type']] ) ) {
    return false;
}

Source: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Echo/+/035f6f4781cf5ebb0f29d1e22e4156472c2f92f2/includes/Model/Event.php#160

When the eventType is unknown - eg not specified in $wgEchoNotifications, the system will return early. This will cause Echo to skip notifications like the newly created SimpleNotification.

We need to decide whether Echo should have a generic presentation model and try to handle/render notifications even if those are unknown. Or should it keep doing what it is doing, eg early return.

This ticket relates to T385810, where we need to decide what would be default MediaWiki behaviour.

Proposed solutions:

Provide a generic Event Type definition

instead of doing isset( $wgEchoNotifications[$info['type']] ) Echo should something like AttributeManager::getTypeDefintion( $info['type']) to return Event definition. When event is not specified it should provide some default "template".

Keep existing behaviour

When Echo is triggered with a notification type that is not specified in $wgEchoNotifications, keep existing logic, eg do an early return and forget the notification.

Event Timeline

Per T385810#10541554 we've decided that yes, Echo must handle unknown notifications.

Let's rephrase this to be a task about implementing that.

matmarex renamed this task from Decide whether Echo should handle unknown notifications to Allow Echo to handle unknown notifications.Feb 25 2025, 12:56 AM

Change #1146813 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/Echo@master] Handle generic events not registered with Echo

https://gerrit.wikimedia.org/r/1146813

Change #1146813 merged by jenkins-bot:

[mediawiki/extensions/Echo@master] Handle generic events not registered with Echo

https://gerrit.wikimedia.org/r/1146813

pmiazga renamed this task from Allow Echo to handle unknown notifications to Allow Echo to handle generic notifications.Jul 2 2025, 2:39 PM