[go: up one dir, main page]

Page MenuHomePhabricator

Error: Widget not found - DiscussionTools try to kicks in when previewing the edit
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

  • jQuery error "Uncaught Error: Widget not found"

Event Timeline

This error also occurs when I have Live Preview enabled (and Realtime Preview disabled) and I click "Show preview" while editing https://commons.wikimedia.org/w/index.php?title=File_talk:Chooz_Nuclear_Power_Plant-9361.jpg&action=edit&uselang=en.

It also occurs when I don't have CodeMirror enabled.

Full error, if it is useful at all:

Uncaught Error: Widget not found
    jQuery 4
load.php:445:739
    jQuery 12
    Choo 3
    jQuery 6
    xhr Choo
    jQuery 6
    Choo 5
    jQuery 12
    add Choo
    js jQuery
    runScript https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    cssHandle https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    flushCssBuffer https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    flushCssBuffer self-hosted:1225
    (Async: FrameRequestCallback)
    addEmbeddedCSS https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    execute https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    doPropagation https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    (Async: requestIdleCallback handler)
    requestIdleCallback self-hosted:1178
    setAndPropagate https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    markModuleReady https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    runScript https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    cssHandle https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    flushCssBuffer https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    flushCssBuffer self-hosted:1225
    (Async: FrameRequestCallback)
    addEmbeddedCSS https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    execute https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    doPropagation https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    (Async: requestIdleCallback handler)
    requestIdleCallback self-hosted:1178
    setAndPropagate https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    markModuleReady https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    runScript https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    cssHandle https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    flushCssBuffer https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    flushCssBuffer self-hosted:1225
    (Async: FrameRequestCallback)
    addEmbeddedCSS https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    execute https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    doPropagation https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    (Async: requestIdleCallback handler)
    requestIdleCallback self-hosted:1178
    setAndPropagate https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    implement https://commons.wikimedia.org/w/load.php?lang=en&modules=startup&
    <anonymous> jQuery
Func subscribed.

The error trace in the browser point to DiscussionTools/modules/ReplyLinksController.js#24 which try to infuse some widget without checking the existence.

Func renamed this task from 1.40.0-wmf.6: Error: Widget not found - ext.CodeMirror.lib on Commonswiki to 1.40.0-wmf.6: Error: Widget not found - DiscussionTools try to kicks in after Live Preview or RealTime Preview.Oct 19 2022, 2:27 PM

The related code is untouched for 2 months, not newly introduced in 1.40.0-wmf.6. (sorry, it was authored months ago but merged in this train.)
And the error would only be triggered on a small number of pages, so it should not block the train of 1.40.0-wmf.6.

Func renamed this task from 1.40.0-wmf.6: Error: Widget not found - DiscussionTools try to kicks in after Live Preview or RealTime Preview to Error: Widget not found - DiscussionTools try to kicks in after Live Preview or RealTime Preview.Oct 19 2022, 2:37 PM
Func added a subscriber: matmarex.

Caused by rEDTOf8d25be872a8: Remove all hacks for old HTML in HTTP cache or parser cache. We have some code in CommentFormatter that is supposed to hide reply buttons when previewing, but it leaves behind some invisible wrapper elements. Code in ReplyLinksController now assumes that if the wrappers exist, then the buttons must exist as well. Previously the compatibility code for old HTML ignored this problem.

I agree, I don't think this is a release blocker. The error only occurs when live-previewing a page with reply links on it, and it doesn't seem to break any functionality. We might want to backport a fix anyway to avoid alarming people with the exceptions being logged.

Change 844021 had a related patch set uploaded (by Func; author: Func):

[mediawiki/extensions/DiscussionTools@master] ReplyLinksController: Skip empty reply buttons container

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

Func renamed this task from Error: Widget not found - DiscussionTools try to kicks in after Live Preview or RealTime Preview to Error: Widget not found - DiscussionTools try to kicks in when previewing the edit.Oct 19 2022, 3:36 PM

(actually can happen in normal preview)

Change 844021 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] ReplyLinksController: Skip empty reply buttons container

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

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

[mediawiki/extensions/DiscussionTools@wmf/1.40.0-wmf.6] ReplyLinksController: Skip empty reply buttons container

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

We're actually logging a significant number of these errors:
https://logstash.wikimedia.org/goto/0eea5179998dc2454d70af6d95dd5808

logstash.wikimedia.org_app_discover.png (400×2 px, 68 KB)

(most but not all in this chart look related to DiscussionTools)

Change 845015 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@wmf/1.40.0-wmf.6] ReplyLinksController: Skip empty reply buttons container

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

Mentioned in SAL (#wikimedia-operations) [2022-10-20T20:35:22Z] <samtar@deploy1002> Finished scap: Backport for [[gerrit:845015|ReplyLinksController: Skip empty reply buttons container (T321185)]] (duration: 05m 23s)

ppelberg claimed this task.