Page MenuHomePhabricator

ToC gets deleted on Vector 2022 skin
Closed, ResolvedPublicBUG REPORT

Description

Multiple people have reported a browser-agnostic bug where, in the Vector 2022 skin, after the page loads, the table of contents get deleted. Note, it does not get collapsed into a button next to the page title, but outright removed, visualized as a "flash".

A user said that this only occurs on some pages, but a page where this can currently be reproduced is https://en.wikipedia.org/wiki/The_Favourite (make sure you are logged out). When I profile this, the offending function seems to be changeActiveSection(). In case the issue can't be reproduced later, I've uploaded the profile, which can be loaded in Google Chrome via Dev Tools > Performance > Load profile.

Original report on reddit, with the reporter saying the issue was resolved, but another commenter saying they still have the problem. Also reported on enwiki.

Developer notes

I think this is a cached html issue related to one of our recent toc class changes (perhaps T325032).

From what I've gathered, the issue relates to this line, which looks for a vector-feature-toc-pinned-enabled class on the html element. If it's not present, the following code moves the toc into it's collapsed stated. It's not present when this issue occurs, but if I bypass the cache by appending ?blah, it is present in the html and bypasses the issue.

Event Timeline

Hi @Opencooper, thanks for taking the time to report this!
I can reproduce in a private window Firefox 110 and Chromium 110 on https://en.wikipedia.org/wiki/The_Favourite but not on https://en.wikipedia.org/wiki/The_Favourite?debug=true . The problem does not happen when I block loading https://en.wikipedia.org/w/load.php?lang=en&modules=jquery&skin=vector-2022

@ovasileva @Jdlrobson I noticed this issue on anon beta and anon mediawiki today as well.

nray updated the task description. (Show Details)

I've added some error logging to English Wikipedia to understand how often this is occurring to help us prioritize this issue.
https://en.wikipedia.org/wiki/MediaWiki:Vector-2022.js

ovasileva raised the priority of this task from High to Unbreak Now!.Mar 10 2023, 10:40 PM
Jdlrobson lowered the priority of this task from Unbreak Now! to High.Mar 10 2023, 11:09 PM

So we investigated this issue and it's an issue that will resolve itself if the page is edited or purged (by appending ?action=purge on the URL)

In the meantime, I've patched this via https://en.wikipedia.org/wiki/MediaWiki:Vector-2022.js for now given the impact was high. The patch makes sure the table of contents is available (albeit not in the sidebar). We can hopefully remove this in a week's time and then close out this ticket.

Jdlrobson lowered the priority of this task from High to Medium.Mar 10 2023, 11:09 PM

I removed the workaround today and restored the error logging. I saw only 24 errors in a period of an hour so I've removed the code from the site JS: https://en.wikipedia.org/w/index.php?title=MediaWiki%3AVector-2022.js&diff=1146933668&oldid=1146911943

Jdlrobson claimed this task.