Page MenuHomePhabricator

Deprecate `EventInsertComplete` hook
Closed, ResolvedPublic

Description

As part of the work to create core notifications system (as part of the yearly KR5.2 to simplify feature development on the platform) work has been done to unify behavior of notifications and simplify its operation. As part of that work, we've identified several hooks that can be deprecated.

Specifically, EventInsertComplete has no callers. Echo creates this hook to inform extensions about Notification being stored in database. The code search - https://codesearch.wmcloud.org/search/?q=EventInsertComplete&files=&excludeFiles=&repos= returns no uses of this hook.

This also relates to the work on

See more information on the project on MediaWiki.

We provide a replacement. By using NotificationMiddleware there is an option to perform operations after calling next(). To refactor code that depends on EventInsertComplete

  1. Event has to be triggered via NotificationService::notify() instead of Event::create()
  2. Add a new Notification Middleware. You can perform any action after calling $next, which means that this Event was successfully sent to a provider.

Details

Event Timeline

pmiazga updated the task description. (Show Details)

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

[mediawiki/extensions/Echo@master] Deprecate the EventInsertComplete hook

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

Change #1170626 merged by jenkins-bot:

[mediawiki/extensions/Echo@master] Deprecate the EventInsertComplete hook

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