Page MenuHomePhabricator

Unexpected OOUI payload on page views (+70KB JS transfer size since 2022-04-14)
Closed, ResolvedPublic

Description

Problem

Screenshot 2022-06-02 at 15.46.03.png (465×524 px, 33 KB)

Grafana: WebPageReplay drillldown

Grafana: WebPageTest drilldown

Analysis

That's quite a hefty increase there all of a sudden.

The timeframe correlates to the 15 min window after the wmf.7 group2 deployment:

  • rebuilt and synchronized wikiversions files: group2 wikis to 1.39.0-wmf.7 refs T305213

I reviewed the changelog at https://www.mediawiki.org/wiki/MediaWiki_1.39/wmf.7 but did not see anything obvious stand out here.

Fortunately, unfortunately, our alerts didn't fire as it did not immediately effect our lab measurements of rendering time (paint) and page load time (PLT). I'll note further down why that is.

And... because we didn't find it earlier via an alert, this means enough time has passed that we no longer have access to the detailed HAR files and browser profiles captured around that time. But.. this is big enough that we can probably see it stand out when just inspecting a page today.

Loading https://en.wikipedia.org/wiki/Barack_Obama in a private tab, I see the following in the Network tab:

Loading the OOUI library is suspect for sure, as we don't do client-side rendering on page load as a general principle (e.g. T112401, guidelines), and indeed there was no Layout Shift or major rendering step that I could spot that involved OOUI or anything else. Which means the payload is unused, and that explains why it didn't fire the alerts for visual completion, layout shifts, etc.

The payload can also be found in another way that's perhaps more user friendly, by invoking mw.inspect (docs, more docs):

mw.inspect size report

namesize
oojs-ui-core176.0 KiB
oojs-ui-widgets101.6 KiB
oojs-ui-core.styles59.8 KiB
ext.popups.main56.8 KiB
jquery.uls.data38.1 KiB

And through a helper script of mine:

mw.loader.findReady('oojs-ui-widgets')
//> [ 0: Array [ "ext.uls.interface" ]

Indicates that ULS is the only entrypoint loaded directly on the page that brings in the module, so that's probably where the regression is coming from.

Going back to the wmf.7 changelog, there is only one ULS change:

Event Timeline

Change 803086 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/UniversalLanguageSelector@master] Load OOUI widgets only when ULS is opened

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

Change 803086 merged by jenkins-bot:

[mediawiki/extensions/UniversalLanguageSelector@master] Load OOUI widgets only when ULS is opened

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

I'm noticing an error in my local dev environment, and I'm wondering if this patch is related. Please see the comment at the bottom of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/UniversalLanguageSelector/+/803086/

Change 803629 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/UniversalLanguageSelector@master] Add explicit dependency to oojs RL module

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

I'm noticing an error in my local dev environment, and I'm wondering if this patch is related. Please see the comment at the bottom of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/UniversalLanguageSelector/+/803086/

Thanks. I am able to reproduce this in a wiki without much extensions and used as anon user.

Change 803536 had a related patch set uploaded (by KartikMistry; author: Santhosh):

[mediawiki/extensions/UniversalLanguageSelector@wmf/1.39.0-wmf.15] Add explicit dependency to oojs RL module

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

Change 803629 merged by jenkins-bot:

[mediawiki/extensions/UniversalLanguageSelector@master] Add explicit dependency to oojs RL module

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

Change 803536 merged by jenkins-bot:

[mediawiki/extensions/UniversalLanguageSelector@wmf/1.39.0-wmf.15] Add explicit dependency to oojs RL module

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

Mentioned in SAL (#wikimedia-operations) [2022-06-08T07:30:20Z] <kartik@deploy1002> Synchronized php-1.39.0-wmf.15/extensions/UniversalLanguageSelector/extension.json: Backport: [[gerrit:803536|Add explicit dependency to oojs RL module (T309793)]] (duration: 03m 31s)

Tested today: Accessing Barack Obama in private tab and running mw.inspect() does not report ooui modules

image.png (728×925 px, 151 KB)

santhosh triaged this task as Medium priority.Jun 14 2022, 6:44 AM