Page MenuHomePhabricator

UserClearNewTalkNotification hook: document UserIdentity instead of User
Closed, ResolvedPublic

Description

As part of T208777: Factor notification-related methods out of User and Title, introduce WatchlistNotificationManager, the replacement for User::clearNotification should only require a UserIdentity, not a full User.

The only place in the method where a full User object is required in for the hook, UserClearNewTalkNotification
Since strong typehinting was only added to hooks in the migration to interfaces in the current version, I don't believe that the object being a User is a part of the stable interface.

According to code search[1], the hook has exactly 1 use, in Echo.

I propose:

  • Update Echo to expect a UserIdentity rather than a User
  • Update interface documentation to type against a UserIdentity rather than a User

[1] https://codesearch.wmflabs.org/search/?q=UserClearNewTalkNotification&i=nope&files=&repos=

Event Timeline

Change 598146 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/Echo@master] UserClearNewTalkNotification: Only require a UserIdentity

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

Change 598146 merged by jenkins-bot:
[mediawiki/extensions/Echo@master] UserClearNewTalkNotification: Only require a UserIdentity

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

Change 599757 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] UserClearNewTalkNotification hook: Only guarantee a UserIdentity

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

Change 599757 merged by jenkins-bot:
[mediawiki/core@master] UserClearNewTalkNotification hook: Only guarantee a UserIdentity

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