Page MenuHomePhabricator

Never-ending "action=discussiontoolscompare" API requests after the reply tool fails to open on an old revision
Closed, ResolvedPublic

Description

Whenever the reply tool fails to open on an old revision for any reason, it keeps sending "action=discussiontoolscompare" API requests forever. This should only occur while the reply tool is open (to notify the user about new comments in the same section).

For example, I can reproduce on https://en.wikipedia.org/w/index.php?title=Wikipedia:Wikipedia_Signpost/2022-04-24/In_the_media&oldid=1089911778 (the reply tool fails there due to T259824).

Additionally, in some cases the following error occurs for every API request: (Originally reported at T312828#8076979 by @Novem_Linguae)

jQuery.Deferred exception: Cannot read properties of null (reading 'then') TypeError: Cannot read properties of null (reading 'then')
    at CommentController.js.CommentController.updateNewCommentsWarning (https://en.wikipedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core%7Cjquery.ui&skin=vector&version=1n2jy:48:439)
    at https://en.wikipedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core%7Cjquery.ui&skin=vector&version=1n2jy:43:362
    at mightThrow (https://en.wikipedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core%7Cjquery.ui&skin=vector&version=1n2jy:338:881)
    at process (https://en.wikipedia.org/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core%7Cjquery.ui&skin=vector&version=1n2jy:339:544)

Curiously it only occurs in some cases, e.g. it happens for the last comment at https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:New_pages_patrol/Coordination&oldid=1098068027 (failing due to T313093), but not in the other example.

Event Timeline

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

[mediawiki/extensions/DiscussionTools@master] CommentController: Fix 'discussiontoolscompare' not stopping after teardown

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

matmarex edited projects, added Editing-team (Kanban Board); removed Editing-team.
matmarex moved this task from Incoming to Code Review on the Editing-team (Kanban Board) board.

I noticed this again while testing the fix for T323661, and this time it reminded me of T316074, which had a nearly identical fix.

Change 863031 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] CommentController: Fix 'discussiontoolscompare' polling not stopping

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