Page MenuHomePhabricator

TOC error in page banners on Russian Wikivoyage
Closed, DuplicatePublic


We have a problem with the recently deployed extension WikidataPageBanner. It is supposed to show a bottom line with TOC. But some of the pages contain the TOC line with symbol "1" right under the banner and the standard Wikimedia TOC on its regular place before the first section. This problem is solved by purging the cache, but it happens way too often. Yesterday I have noticed it at least 15 times. Purging of the cache had temporary effect, and the problem appeared again after 1-2 hours, even though no edits were done to that pages.

Today we tried to track the problem and arrived at rather confusing results here:Пивная_путешественников#Пропал_баннер_в_пивной

We identified several pages where the problem appears:НовосибирскИорданияСамараДимитровград

but it does not appear for all users. For example, I don't see it when I am logged in, and I see the problem when I log out.

Altogether, this became a frequent and annoying problem that needs to be solved. Wrong performance of the pagebanner extension has huge (and unpredictable) influence on the appearance of Wikivoyage articles.

Event Timeline

Atsirlin created this task.Oct 29 2015, 3:31 PM
Atsirlin raised the priority of this task from to High.
Atsirlin updated the task description. (Show Details)
Atsirlin added a project: Wikidata-Page-Banner.
Atsirlin added subscribers: Atsirlin, Jdlrobson, Sumit.
Restricted Application added a project: Wikidata. · View Herald TranscriptOct 29 2015, 3:31 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Sorry about this :( It should be fixed now (see discussion in other bug) but we have no way to clear cache. It might be possible to ask operations to purge html but I suspect that might be too costly an operation...

It looks like we have got this problem after the update. When exactly did it happen?

Actually I had an idea...
Add this code to MediaWiki:Mobile.js and it will purge existing pages when the problem is encountered (e.g. crowd source purging the cache where needed)

if ($( '.wpb-banner-toc' ).text() === '1' ) { $.post( mw.util.getUrl( mw.config.get( 'wgTitle' ), { action: 'purge' } ) ) }

No 1 should be generated as of Wednesday. I'm still not exactly sure how this started happening but the bug was in the code from the day it was deployed and seems to impact older pages.

added to Mobile.js, but why Mobile.js? We are talking about desktop version. Should it be added to Common.js as well?

my thinking was mobile traffic was less so less traffic would hit purge urls but actually on second thought Common.js would probably make more sense but be sure to remove it if you notice any slowdown on the site and as soon as the problem goes away (I'm not yet sure of the scale of this problem and how many pages it impacts). On other bug it seems editing the template may help too!

Now I have it in Mobile.js and Vector.js. Should be enough, while adding the same line to Common.js will be redundant, right?

I have edited the template right now and also earlier this morning, but as far as I can see this did not help.

Yeh if it is in Common.js delete it from Vector and mobile as otherwise it will run twice (bad! ) :)
It will take time to see the results.

Essentially all the code does is this:
check if the toc is 1
if it is purge the cache.

@Jdlrobson: thanks for your support! At first glance, the problem has been resolved, although we still have to see how it develops after the patches in Vector.js and Mobile.js are removed