Page MenuHomePhabricator

Tag errors where a banner is being displayed
Closed, ResolvedPublic

Description

There have been a few errors relating to banners recently that have been extremely hard to debug (T264786, T264952)
The error client could provide a clue to a banner being the cause by adding the value of mw.centralNotice.isBannerShown()

Note it's possible we could even log the name of the banner mw.centralNotice.getDataProperty( 'banner' ); but that warrants further investigation and the boolean should be sufficient enough for now.

The tag will also allow us to create a fundraising banner dashboard for catching and addressing these errors as banners are enabled.

Related Objects

Event Timeline

Change 633034 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/WikimediaEvents@master] Tag errors when a banner is displayed

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

(blocker for rolling out to enwiki)

Change 634295 had a related patch set uploaded (by Jdlrobson; owner: Jason Linehan):
[mediawiki/extensions/WikimediaEvents@master] clientError: Adds 'is_user_logged_in' and 'is_banner_shown' fields

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

Change 633034 abandoned by Jdlrobson:
[mediawiki/extensions/WikimediaEvents@master] Tag errors when a banner is displayed

Reason:
Since a schema change is required this is being done as part of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaEvents/ /634295

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

Hi @Jdlrobson, not sure what the status of this is. Is it still something that you're working on?

Change 634295 abandoned by Jdlrobson:

[mediawiki/extensions/WikimediaEvents@master] clientError: Adds new fields and updates behavior.

Reason:

No longer being worked on

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

It's been causing less problems so I haven't thought too much of this and haven't been working on it.

The more important underlying issue here is making sure banners work cross browser without errors and when they do, we know banners cause them. Thinking about this through a more modern lens, one solution to this would be to make sure that all banner code is not run in global scope (at least for new campaigns). Would that be possible? If so perhaps we can decline this in favor of doing that?

e.g.
Right now we do:

<banner code>

Instead we'd do:

( function runCentralNoticeBanner() {
   <banner code>
} () )

That would make sure any error in the banner code has runCentralNoticeBanner in the stack trace.

Change 829300 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/WikimediaEvents@master] Tag errors when a banner is displayed

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

Change 829300 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Tag errors when a banner is displayed

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