Page MenuHomePhabricator

Error on Special:Notifications page when a page on my watchlist got deleted by another user: EchoEventPresentationModel::getTruncatedTitleText() must be an instance of Title, null given
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce:

  • add $wgEchoWatchlistNotifications = true; to the LocalSettings.php to get watchlist notifications
  • enable web notifications for "Edit to watched page" in your notification preferences
  • add a page to your watchlist
  • have another user (or you on another account) delete the page
  • visit Special:Notifications

What happens?:
an Internal error is displayed

What should have happened instead?:
the Special:Notifications page should be displayed

Software version, other information, etc:

MediaWiki Version: 1.35.1 (889d124)
Echo Version: – (rECHOfd6a33e7b8f2)

error on page Special:Notifications

EventPresentationModel.php: Argument 1 passed to EchoEventPresentationModel::getTruncatedTitleText() must be an instance of Title, null given

/Special:Notifications TypeError from line 564 of <server>/extensions/Echo/includes/formatters/EventPresentationModel.php: Argument 1 passed to EchoEventPresentationModel::getTruncatedTitleText() must be an instance of Title, null given, called in <server>/extensions/Echo/includes/formatters/WatchlistChangePresentationModel.php on line 31

Backtrace:

#0 <server>/extensions/Echo/includes/formatters/WatchlistChangePresentationModel.php(31): EchoEventPresentationModel->getTruncatedTitleText()
#1 <server>/extensions/Echo/includes/formatters/SpecialNotificationsFormatter.php(45): EchoWatchlistChangePresentationModel->getHeaderMessage()
#2 <server>/extensions/Echo/includes/formatters/EchoEventFormatter.php(72): SpecialNotificationsFormatter->formatModel()
#3 <server>/extensions/Echo/includes/DataOutputFormatter.php(189): EchoEventFormatter->format()
#4 <server>/extensions/Echo/includes/DataOutputFormatter.php(149): EchoDataOutputFormatter::formatNotification()
#5 <server>/extensions/Echo/includes/special/SpecialNotifications.php(61): EchoDataOutputFormatter::formatOutput()
#6 <server>/includes/specialpage/SpecialPage.php(600): SpecialNotifications->execute()
#7 <server>/includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run()
#8 <server>/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#9 <server>/includes/MediaWiki.php(940): MediaWiki->performRequest()
#10 <server>/includes/MediaWiki.php(543): MediaWiki->main()
#11 <server>/index.php(53): MediaWiki->run()
#12 <server>/index.php(46): wfIndexMain()
#13 {main}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Aklapper renamed this task from Internal error on Special:Notifications page when a page on my watchlist got deleted by another user to Error on Special:Notifications page when a page on my watchlist got deleted by another user: EchoEventPresentationModel::getTruncatedTitleText() must be an instance of Title, null given.Jul 6 2021, 7:17 PM

@Robis_Koopmans can you try a more recent version of Echo please?

what version do you suggest to try?

@kostajh

git pull
remote: Enumerating objects: 103, done.
remote: Counting objects: 100% (103/103), done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 103 (delta 66), reused 91 (delta 54), pack-reused 0
Receiving objects: 100% (103/103), 57.82 KiB | 11.56 MiB/s, done.
Resolving deltas: 100% (66/66), completed with 30 local objects.
From https://github.com/wikimedia/mediawiki-extensions-Echo
   7887043b..6c3c93da  REL1_36           -> origin/REL1_36
   7d39fca9..742da14e  master            -> origin/master
 * [new branch]        wmf/1.37.0-wmf.11 -> origin/wmf/1.37.0-wmf.11
 * [new branch]        wmf/1.37.0-wmf.12 -> origin/wmf/1.37.0-wmf.12
 * [new branch]        wmf/1.37.0-wmf.13 -> origin/wmf/1.37.0-wmf.13
Already up to date.

what version do you suggest to try?

@kostajh

git pull
remote: Enumerating objects: 103, done.
remote: Counting objects: 100% (103/103), done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 103 (delta 66), reused 91 (delta 54), pack-reused 0
Receiving objects: 100% (103/103), 57.82 KiB | 11.56 MiB/s, done.
Resolving deltas: 100% (66/66), completed with 30 local objects.
From https://github.com/wikimedia/mediawiki-extensions-Echo
   7887043b..6c3c93da  REL1_36           -> origin/REL1_36
   7d39fca9..742da14e  master            -> origin/master
 * [new branch]        wmf/1.37.0-wmf.11 -> origin/wmf/1.37.0-wmf.11
 * [new branch]        wmf/1.37.0-wmf.12 -> origin/wmf/1.37.0-wmf.12
 * [new branch]        wmf/1.37.0-wmf.13 -> origin/wmf/1.37.0-wmf.13
Already up to date.

Try rECHO742da14e752a: Localisation updates from https://translatewiki.net. although that might require a newer version of MediaWiki core than you have, not sure.

Yes unfortunately it does Uncaught ExtensionDependencyError: Echo is not compatible with the current MediaWiki core (version 1.35.1), it requires: >= 1.37.0. in

I was able to reproduce this using the most recent version from git of both echo and MediaWiki core.

Change 736484 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/Echo@master] Construct title from RC title params

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

Change 736484 merged by jenkins-bot:

[mediawiki/extensions/Echo@master] Construct title from RC title params

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

Etonkovidova claimed this task.
Etonkovidova subscribed.

Checked on enwiki betalabs only. The issue is fixed; the previous notifications from deleted pages on watchlist get deleted without affecting Special:Notifications page display.

Pastakhov subscribed.

This issue is not fixed. How do "the previous notifications from deleted pages on watchlist get deleted"? the patch https://gerrit.wikimedia.org/r/736484 fixes the issue for the newly created notifications because it adds the extra page_title and page_namespace parameters and then creates the Title object using ones. But for notifications created before the patch is applied, it crashes with the error message.

Change 985643 had a related patch set uploaded (by Pastakhov; author: Pastakhov):

[mediawiki/extensions/Echo@master] Fix for Watchlist Notifications for deleted pages created in 1.35

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

This issue is not fixed. How do "the previous notifications from deleted pages on watchlist get deleted"? the patch https://gerrit.wikimedia.org/r/736484 fixes the issue for the newly created notifications because it adds the extra page_title and page_namespace parameters and then creates the Title object using ones. But for notifications created before the patch is applied, it crashes with the error message.

Thanks, @Pastakhov! Yes, the task should be opened, since I checked only the most current version on beta cluster - 1.42.0-alpha (should've mentioned it in my comment, sorry). The filed issue seemed serious, so it was worth checking the current behavior. On 1.42.0-alpha all seems to be working as expected (the details of testing are below).

Testing notes (done on 1.42.0-alpha):

  • User A adds two pages to Watchlist; the option Edit to watched page in Preferences-Notifications is enabled
  • User A creates a filter on RecentChanges: On Watchlist and New Watchlist changes ; the Watchlist list of pages displays the newly added page titles
  • User B makes edits to one of the pages (another page on the User A Watchlist is not edited to see whether it will be deleted from User A Watchlist when User B deletes it)
  • User A sees all changes that User B has done and a notification(s) come, the RC filter displays the edit(s), Watchlist filters display changes too.
  • User B deletes both pages
  • User A checking notifications after the pages were deleted: 1) Special:Notifications page works as expected; doesn't see the notifications about previous edits on watched page(s) 2) sees the "deleted page" notifications 3) all saved filters and Watchlist display the Deletion log info that the watched pages were deleted 4) all previous actions on deleted pages are removed from Watchlist and RecentChanges

Also, there is https://endoflife.date/mediawiki on the support for MediaWiki versions.

Change #985643 had a related patch set uploaded (by Aklapper; author: Pastakhov):

[mediawiki/extensions/Echo@master] Fix for Watchlist Notifications for deleted pages created in 1.35

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

Change #985643 merged by jenkins-bot:

[mediawiki/extensions/Echo@master] Fix for Watchlist Notifications for deleted pages created in 1.35

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

Change #1113966 had a related patch set uploaded (by Pastakhov; author: Pastakhov):

[mediawiki/extensions/Echo@REL1_39] Fix for Watchlist Notifications for deleted pages created in 1.35

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

Reopened for reviewing the cherry-picked patch for the supported REL1_39 (LTS) branch. https://gerrit.wikimedia.org/r/1113966

Change #1113966 merged by jenkins-bot:

[mediawiki/extensions/Echo@REL1_39] Fix for Watchlist Notifications for deleted pages created in 1.35

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

Pppery claimed this task.
Pppery removed Pppery as the assignee of this task.

Change #1132100 had a related patch set uploaded (by Pastakhov; author: Pastakhov):

[mediawiki/extensions/Echo@REL1_43] Fix for Watchlist Notifications for deleted pages created in 1.35

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

Change #1132100 merged by jenkins-bot:

[mediawiki/extensions/Echo@REL1_43] Fix for Watchlist Notifications for deleted pages created in 1.35

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