Page MenuHomePhabricator

Internal error when you attempt to email a user you've blocked from Notifications
Closed, ResolvedPublic


Problem: When a user is blocked from notifying you using the new notification blacklist and then attempts to email you they get an Internal error/backtrace

Notes: The email goes through (and the notification does not) which is likely how we want it but the error is obviously not as designed and also reveals to the sender that they are blocked from notifications (if they can figure it out/read the backtrace).

Recreation steps:

  • User A places User B on their notification blacklist on Special:Preferences
  • User B goes to Special:EmailUser and tries to send an email to User A.


  • User A gets email
  • No one gets a notification
  • User B gets a backtrace/Internal error
[WS3sHwpEE4AAABIG7V8AAAAF] /wiki/Special:EmailUser BadMethodCallException from line 436 of /srv/mediawiki/php-master/extensions/Echo/includes/controller/NotificationController.php: Call to a member function getNamespace() on a non-object (null)


#0 /srv/mediawiki/php-master/extensions/Echo/includes/iterator/FilteredSequentialIterator.php(120): Closure$EchoNotificationController::getUsersToNotifyForEvent#5(User)
#1 [internal function]: Closure$EchoFilteredSequentialIterator::createFilter#2(User, integer, ArrayIterator)
#2 [internal function]: CallbackFilterIterator->accept()
#3 [internal function]: FilterIterator->fetch()
#4 /srv/mediawiki/php-master/extensions/Echo/includes/controller/NotificationController.php(126): FilterIterator->rewind()
#5 /srv/mediawiki/php-master/extensions/Echo/includes/model/Event.php(171): EchoNotificationController::notify(EchoEvent, boolean)
#6 /srv/mediawiki/php-master/extensions/Echo/Hooks.php(1337): EchoEvent::create(array)
#7 /srv/mediawiki/php-master/includes/Hooks.php(186): EchoHooks::onEmailUserComplete(MailAddress, MailAddress, string, string)
#8 /srv/mediawiki/php-master/includes/specials/SpecialEmailuser.php(443): Hooks::run(string, array)
#9 /srv/mediawiki/php-master/includes/specials/SpecialEmailuser.php(314): SpecialEmailUser::submit(array, DerivativeContext)
#10 /srv/mediawiki/php-master/includes/htmlform/HTMLForm.php(663): SpecialEmailUser::uiSubmit(array, HTMLForm)
#11 /srv/mediawiki/php-master/includes/htmlform/HTMLForm.php(555): HTMLForm->trySubmit()
#12 /srv/mediawiki/php-master/includes/htmlform/HTMLForm.php(570): HTMLForm->tryAuthorizedSubmit()
#13 /srv/mediawiki/php-master/includes/specials/SpecialEmailuser.php(177): HTMLForm->show()
#14 /srv/mediawiki/php-master/includes/specialpage/SpecialPage.php(522): SpecialEmailUser->execute(NULL)
#15 /srv/mediawiki/php-master/includes/specialpage/SpecialPageFactory.php(578): SpecialPage->run(NULL)
#16 /srv/mediawiki/php-master/includes/MediaWiki.php(287): SpecialPageFactory::executePath(Title, RequestContext)
#17 /srv/mediawiki/php-master/includes/MediaWiki.php(862): MediaWiki->performRequest()
#18 /srv/mediawiki/php-master/includes/MediaWiki.php(523): MediaWiki->main()
#19 /srv/mediawiki/php-master/index.php(43): MediaWiki->run()
#20 /srv/mediawiki/w/index.php(3): include(string)
#21 {main}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 356320 had a related patch set uploaded (by Mattflaschen; owner: Mattflaschen):
[mediawiki/extensions/Echo@master] Fix user talk exception for blacklist

Change 356320 merged by jenkins-bot:
[mediawiki/extensions/Echo@master] Fix user talk exception for blacklist


  • User A gets email
  • No one gets a notification
  • User B gets a backtrace/Internal error

Checked the fix - now:

  • User A does not get an email [corrected after re-checking]
  • User A does not get Echo notification about the email sent by User B (blocked by User A)
  • No one gets any errors

Two things to consider:

  • if a blocked user changes user rights - the Echo notification won't come.
  • Email notifications (along with Echo notifications) won't come from a blocked user (the Block list refers only to Echo notifications)

per @Mattflaschen-WMF it seems to be the expected behavior.

  • User A does not get an email

Are you sure about this? They should still get the EmailUser user->user email.

@Mattflaschen-WMF sorry, I forgot to correct my comment above. Emails via Special:EmailUser sent by blocked users will be received.