Page MenuHomePhabricator

Recent message fallback change breaks fundraising banners
Closed, ResolvedPublic

Description

The deployed solution to T300069 (showing the correct message title when viewing with qqx) has bad side-effects when the string '$/' exists in a banner. Fundraising banners that include regexes are throwing JS errors 'Unterminated regular expression literal'

For example:

https://en.wikipedia.org/wiki/Wikipedia?banner=B2122_0119_enWW_dsk_p1_lg_template&country=US

Could we revert https://gerrit.wikimedia.org/r/c/mediawiki/core/+/761486 or update it with a different delimiter that doesn't break regexes?

Note: It happens that Fundraising banners are not live right now. However, this also breaks FR banner previews, needed to test banners that are expected to go live shortly.

Event Timeline

Ejegg triaged this task as Unbreak Now! priority.Feb 24 2022, 1:13 AM

Change 765359 had a related patch set uploaded (by Ejegg; author: Ejegg):

[mediawiki/core@master] Use less-common placeholders for qqx formatting

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

Change 765360 had a related patch set uploaded (by Ejegg; author: Ejegg):

[mediawiki/core@master] Revert \"Show message fallback keys when using &uselang=qqx\"

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

Change 765360 merged by jenkins-bot:

[mediawiki/core@master] Revert \"Show message fallback keys when using &uselang=qqx\"

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

RhinosF1 added a project: User-RhinosF1.
RhinosF1 subscribed.

Stealing to help get deployed.

Change 765369 had a related patch set uploaded (by RhinosF1; author: Ejegg):

[mediawiki/core@wmf/1.38.0-wmf.23] Revert \"Show message fallback keys when using &uselang=qqx\"

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

Change 765369 merged by jenkins-bot:

[mediawiki/core@wmf/1.38.0-wmf.23] Revert \"Show message fallback keys when using &uselang=qqx\"

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

Deployment tests failed:

load.php?lang=en-gb&modules=ext.graph.vega2|jquery|jquery.ui&skin=vector&version=19zuz:747 Uncaught RangeError: Incorrect locale information provided
    at new NumberFormat (<anonymous>)
    at Object.frb.formatCurrency (<anonymous>:1645:25)
    at HTMLDocument.<anonymous> (<anonymous>:2179:25)
    at mightThrow (en.wikipedia.org/w/load.php?lang=en-gb&modules=ext.graph.vega2%7Cjquery%7Cjquery.ui&skin=vector&version=19zuz:744:881)
    at process (en.wikipedia.org/w/load.php?lang=en-gb&modules=ext.graph.vega2%7Cjquery%7Cjquery.ui&skin=vector&version=19zuz:745:544)
frb.formatCurrency @ VM1016:1645
(anonymous) @ VM1016:2179
mightThrow @ load.php?lang=en-gb&modules=ext.graph.vega2|jquery|jquery.ui&skin=vector&version=19zuz:744
process @ load.php?lang=en-gb&modules=ext.graph.vega2|jquery|jquery.ui&skin=vector&version=19zuz:745
load.php?lang=en-gb&modules=ext.graph.vega2|jquery|jquery.ui&skin=vector&version=19zuz:747 Uncaught RangeError: Incorrect locale information provided
    at new NumberFormat (<anonymous>)
    at Object.frb.formatCurrency (<anonymous>:1645:25)
    at HTMLInputElement.<anonymous> (<anonymous>:1975:34)
    at Function.each (en.wikipedia.org/w/load.php?lang=en-gb&modules=ext.graph.vega2%7Cjquery%7Cjquery.ui&skin=vector&version=19zuz:700:285)
    at jQuery.fn.init.each (en.wikipedia.org/w/load.php?lang=en-gb&modules=ext.graph.vega2%7Cjquery%7Cjquery.ui&skin=vector&version=19zuz:698:93)
    at Object.frb.localizeAmountOptions (<anonymous>:1965:41)
    at HTMLDocument.<anonymous> (<anonymous>:2288:9)
    at mightThrow (en.wikipedia.org/w/load.php?lang=en-gb&modules=ext.graph.vega2%7Cjquery%7Cjquery.ui&skin=vector&version=19zuz:744:881)
    at process (en.wikipedia.org/w/load.php?lang=en-gb&modules=ext.graph.vega2%7Cjquery%7Cjquery.ui&skin=vector&version=19zuz:745:544)

Change 765371 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/core@wmf/1.38.0-wmf.23] Revert \"Revert \"Show message fallback keys when using &uselang=qqx\"\"

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

Change 765371 merged by Urbanecm:

[mediawiki/core@wmf/1.38.0-wmf.23] Revert \"Revert \"Show message fallback keys when using &uselang=qqx\"\"

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

Thanks so much @Urbanecm @RhinosF1 @Ammarpad! We'll dig in later today to figure out what caused the deploy to fail.

Also note that it happens that Fundraising banners are not live right now. However, this does also break banner previews, needed to test banners that are expected to go live shortly.

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

[mediawiki/core@master] Only apply transformations for &uselang=qqx when actually using it

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

(This is my proposed fix for later, we just probably just revert for now)

Well, feel free to review and merge and backport my patch in that case, but I'm pretty sure it worked fine, and the error was unrelated; see T300069#7736271.

The revert was deployed for real in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/765626 (which wasn't tagged with this task).

DStrine set Final Story Points to 2.

Change 765601 merged by jenkins-bot:

[mediawiki/core@master] Only apply transformations for &uselang=qqx when actually using it

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

Change 765359 abandoned by Ammarpad:

[mediawiki/core@master] Use less-common placeholders for qqx formatting

Reason:

The issue has been resolved with Ib0e282b3864caf345e42dd7af4a529f43ae7ba67

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