Page MenuHomePhabricator

[1.26-wmf17 Regression] Dismissed site notice flashes briefly on page load
Closed, ResolvedPublic5 Estimated Story Points

Description

We are experiencing some weird issues regarding Javascript on trwiki. Upon page load, currently "active" sitenotice pops up and after a short time gets hidden.

From @Krinkle at T109766:

After dismissing the local site notice, on every subsequent page visit the site notice is still shown every time briefly before being hidden this is a nuisance to the end-user.
Previously this "worked" by executing JavaScript in the top queue synchronously before the first render. The code in question (ext.dismissableSiteNotice.js) adds an inline stylesheet to the page that will inform the browser ahead of time to hide the sitenotice if the dismiss cookie is set. Then, when the browser proceeded to parse and render the page, the site notice was display-none from the first render directly.
We need to figure out a different way to do this, and it has to work for anonymous users as well.

Event Timeline

Superyetkin raised the priority of this task from to High.
Superyetkin updated the task description. (Show Details)
Superyetkin subscribed.
He7d3r renamed this task from Javascript loading issues after 1.26-wmf17 update to On page-load, a flash of expanded Site Notice is seen before it collapses (after 1.26-wmf17 update).Aug 9 2015, 7:55 PM

What are exact steps to reproduce this? Is that "Try any page on tr.wp"? Which loading times do you face (see the "Network" tab of the developer tools of your web browser)? Any error messages in the web browser's error console?

For more information about the developer tools, please see:

Aklapper raised the priority of this task from High to Needs Triage.Aug 10 2015, 2:16 PM

Going to https://tr.wikipedia.org/wiki/Ana_Sayfa it does not collapse for me. Firefox 39 here...

What are exact steps to reproduce this? Is that "Try any page on tr.wp"? Which loading times do you face (see the "Network" tab of the developer tools of your web browser)? Any error messages in the web browser's error console?

Yes, the issue appears on every page. The average load time is about 400 ms whereas similar pages load in under 200 ms on enwiki.

Any error messages in the web browser's error console?

And here nothing ever collapses. :( What are steps to reproduce?

I would start by evaluating https://tr.wikipedia.org/wiki/Kullanıcı:Superyetkin/common.js
At least the first 3 lines are no longer according to current recommendations.

I would start by evaluating https://tr.wikipedia.org/wiki/Kullanıcı:Superyetkin/common.js
At least the first 3 lines are no longer according to current recommendations.

The issue is not limited to a specific user. Logged out users also suffer from that.

TheDJ edited projects, added DismissableSiteNotice; removed WMF-General-or-Unknown.

Confirmed. This is due to how DismissableSiteNotice is implemented. We should probably make the site notice initially invisible, when the client supports js.

This behavior probably changed due to T107399.

Krinkle renamed this task from On page-load, a flash of expanded Site Notice is seen before it collapses (after 1.26-wmf17 update) to [1.26-wmf17 Regression] Dismissed site notice flashes briefly on page load.Aug 20 2015, 8:50 PM
Krinkle triaged this task as High priority.
Krinkle updated the task description. (Show Details)
Krinkle edited projects, added Regression, Performance-Team; removed JavaScript.
Krinkle added subscribers: ori, Krinkle.

We've just added a site notice to nlwiki and various users (including me) are seeing this. Any update on this?

The sitenotice on nlwiki is now only being displayed to some. https://phabricator.wikimedia.org/T114652

We need the sitenotice... Please revert whatever it is you did to fix the lesser problem.

The sitenotice on nlwiki is now only being displayed to some. https://phabricator.wikimedia.org/T114652

That is unrelated to this task which is about the site notice flashing briefly on page load. Please see T114652 for handling the current issue on nlwiki.

The sitenotice on nlwiki is now only being displayed to some. https://phabricator.wikimedia.org/T114652

That is unrelated to this task which is about the site notice flashing briefly on page load. Please see T114652 for handling the current issue on nlwiki.

I think it is related, because fixing the flashing might be the cause of the problem of a sitenotice not displaying. How many people do you think are currently messing with sitenotice software, not many, and this place is the most likely cause. Whomever is doing anything reads this page. The best way for me to tell them to stop it is here.

Also note that most people following this thread are from nl.wiki (Sjoerddebruin, Trijnstel, Krinkle, TheDJ, Taketa, Mbch331). This thread is nl.wiki related.

@Taketa: There is no indicator yet that someone has "messed with sitenotice software". This task is still open and no related software code changes are mentioned in its comments. If you are aware of specific indicators, please bring them up in T114652 which is the dedicated ticket for the nlwiki issue. Thanks for your understanding.

This is a really annoying bug, needs to be fixed ASAP.

Calling this "a nuisance" is a huge understatement! Today's new sitenotice includes a picture of an owl. The damn bird keeps popping up at every page change.

Well, clearly there's a mw.loader.load([(...)"ext.dismissableSiteNotice"]); in html in every page. But for some reason the js script does not load until the page render.

EDIT: @Krinkle explained it

This was reported in the Community Tech satisfaction survey, from a user on Chinese WP.

Text of the report: "Phabricator requests are left undone for months. This is unacceptable. I also work on the Dutch Wikipedia. The entire community is annoyed by a problem and the tech support does not even know how large the problem is. The same problem is happening on the Turkish Wikipedia where you also do not realise how large the problem is. If you cannot help 100 people to solve their problem then you are doing something wrong. Solve this: https://phabricator.wikimedia.org/T108513 "

DannyH renamed this task from [1.26-wmf17 Regression] Dismissed site notice flashes briefly on page load to [1.26-wmf17 Regression] Dismissed site notice flashes briefly on page load (zh, tr, nl).Oct 28 2015, 4:38 PM
DannyH edited a custom field.

@DannyH: I'm not able to reproduce on zh.wiki. After dismissing the site notice and reloading, I don't see a flash of the site notice. If you are still able to reproduce, let me know what browser you're using.

I'm not sure if this is related, but there were 3 broken gadgets on Turkish Wikipedia that were causing JavaScript errors, including one that was loading its own ancient version of jQuery. I've fixed the gadgets on there, but since there isn't a sitenotice running any more, I have no idea if this bug is still present.

I can reproduce on test.wikipedia.org.

Yeah, sorry -- I can't reproduce on Chinese. It's just a lag in showing it. Dismissing works fine.

kaldari renamed this task from [1.26-wmf17 Regression] Dismissed site notice flashes briefly on page load (zh, tr, nl) to [1.26-wmf17 Regression] Dismissed site notice flashes briefly on page load.Oct 28 2015, 10:01 PM

Change 249580 had a related patch set uploaded (by Kaldari):
Make dismissable SiteNotices hidden by default so they don't flash

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

Change 249580 merged by jenkins-bot:
Make dismissable SiteNotices hidden by default so they don't flash

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

Change 250157 had a related patch set uploaded (by Krinkle):
Make dismissable SiteNotices hidden by default so they don't flash

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

Cleared cache, but I still see it https://nl.wikipedia.org/wiki/special:randompage

That's because the fix won't be deployed until the next site update (next week).

Change 250157 merged by jenkins-bot:
Make dismissable SiteNotices hidden by default so they don't flash

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

Code changes are normally deployed on a weekly basis. Yesterday, the fix was merged into the alpha version which is currently live on the Beta Cluster (http://en.wikipedia.beta.wmflabs.org/). It will go out in the weekly deployment next week.

However, since this was a regression, I've backported it to the live deployment now. Should be live for nlwiki in 5-10 minutes from now.

I did a couple dozen checks. It works :). Thanks for the good work.

Should we backport this to 1.26 perhaps ?

Change 250168 had a related patch set uploaded (by Zhuyifei1999):
Make dismissable SiteNotices hidden by default so they don't flash

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

Change 250168 merged by jenkins-bot:
Make dismissable SiteNotices hidden by default so they don't flash

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