Page MenuHomePhabricator

Disable error tracking for user sessions which generate high amount of errors
Closed, ResolvedPublic

Description

Potential solution to T262493

Over the past few months, there is a user who is actively developing scripts who has been throwing 500+ errors a day. It is clear from interacting with the said user that they are not familiar with JavaScript. Because we have no obvious way to filter errors from these scripts other than to manually filter out client IPs, left unchecked this often leads to missed errors by creating too much noise in logstash.

Although I have proposed a strawman proposal, I encourage any other ideas on how to deal with this.

Strawman proposal: Trip switch for logged in users

Given any user can edit their JS and CSS and is free to do that despite the disclaimer, I think it would be useful to add a hidden user preferences that defaults to true (report-software-bugs)

Using session ID (mw.storage.session) I suggest we log errors per session, and when a logged in user triggers more than 200 errors from a single session, a JavaScript call would be made to the API to disable the preference. The user would then have to opt back in.

Obviously, in situations where a high profile global error is introduced from code in Wikimedia repositories, there is a challenge that we'll end up disabling error logging for a large amount of users. To counter this, we could cache an expiry token in localStorage and when absent, restore the preference.

In future we might surface this preference to users in the user interface, but that is left for another time.

Event Timeline

Jdlrobson claimed this task.

Now possible with:

mw.loader.using('mediawiki.storage').then(function () {
  mw.storage.session.set( 'client-error-opt-out', '1' );
});