mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-27 15:40:15 +00:00
Remove client side error counting
Bug: T266359 Change-Id: I5350c801e7ecb7b8b28e54410cc57fd3b548b2ef
This commit is contained in:
parent
12940ac3eb
commit
ed0222b0d0
|
@ -36,12 +36,6 @@ for the page.
|
|||
Controls whether site notices should be shown.
|
||||
See <https://www.mediawiki.org/wiki/Manual:$wgSiteNotice>.
|
||||
|
||||
#### $wgMinervaCountErrors
|
||||
* Type: `Boolean`
|
||||
* Default: `false`
|
||||
|
||||
Whether to count client side errors in statsv.
|
||||
|
||||
#### $wgMinervaShowCategoriesButton
|
||||
|
||||
* Type: `Array`
|
||||
|
|
|
@ -37,6 +37,6 @@
|
|||
},
|
||||
{
|
||||
"resourceModule": "skins.minerva.scripts",
|
||||
"maxSize": "12.1KB"
|
||||
"maxSize": "11.8KB"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -330,7 +330,6 @@ class MinervaHooks {
|
|||
$roConf = MediaWikiServices::getInstance()->getConfiguredReadOnlyMode();
|
||||
$vars += [
|
||||
'wgMinervaABSamplingRate' => $config->get( 'MinervaABSamplingRate' ),
|
||||
'wgMinervaCountErrors' => $config->get( 'MinervaCountErrors' ),
|
||||
'wgMinervaReadOnly' => $roConf->isReadOnly(),
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
( function ( track, config, trackSubscribe, user ) {
|
||||
module.exports = function () {
|
||||
var suffix = user.isAnon() ? '.anon' : '.loggedin',
|
||||
// we will keep track of errors counted, so that we don't overcount problematic
|
||||
// browsers/users which are generating multiple issues. See MAX_ERRORS.
|
||||
reportedInThisSession = 0,
|
||||
// Very conservative for now.
|
||||
// After this many errors are tracked, no more will be logged.
|
||||
MAX_ERRORS = 5,
|
||||
COUNTER_NAME = 'counter.MediaWiki.minerva.WebClientError' + suffix;
|
||||
|
||||
/**
|
||||
* Count javascript errors, except for those associated with localStorage
|
||||
* being full or unavailable.
|
||||
*
|
||||
* @param {string} topic name of the event being tracked
|
||||
* @param {Object} data event payload
|
||||
*/
|
||||
function countError( topic, data ) {
|
||||
var isLocalStorage = data && data.source === 'store-localstorage-update';
|
||||
// Some errors, for example the Leaflet "Set map center and zoom first"
|
||||
// error (T257872) can trigger a high volume of client side error reports to the server.
|
||||
// At time of writing 1 IP logged 245 errors in the same session and page and another
|
||||
// logged 3,029 errors across 2 pages. To filter these kind of errors out, set a cap
|
||||
// on the amount of errors that can be logged in a single session.
|
||||
if ( !isLocalStorage && reportedInThisSession < MAX_ERRORS ) {
|
||||
track( COUNTER_NAME, 1 );
|
||||
}
|
||||
reportedInThisSession++;
|
||||
}
|
||||
|
||||
if ( config.get( 'wgMinervaCountErrors' ) ) {
|
||||
// track RL exceptions
|
||||
trackSubscribe( 'resourceloader.exception', countError );
|
||||
// setup the global error handler
|
||||
trackSubscribe( 'global.error', countError );
|
||||
}
|
||||
};
|
||||
}(
|
||||
mw.track,
|
||||
mw.config,
|
||||
mw.trackSubscribe,
|
||||
mw.user
|
||||
) );
|
|
@ -16,7 +16,6 @@ module.exports = function () {
|
|||
toast = mobile.toast,
|
||||
Icon = mobile.Icon,
|
||||
time = mobile.time,
|
||||
errorLogging = require( './errorLogging.js' ),
|
||||
preInit = require( './preInit.js' ),
|
||||
mobileRedirect = require( './mobileRedirect.js' ),
|
||||
search = require( './search.js' ),
|
||||
|
@ -416,7 +415,6 @@ module.exports = function () {
|
|||
issues.init( overlayManager, currentPageHTMLParser );
|
||||
}
|
||||
|
||||
mw.requestIdleCallback( errorLogging );
|
||||
// deprecation notices
|
||||
mw.log.deprecate( router, 'navigate', router.navigate, 'use navigateTo instead' );
|
||||
|
||||
|
|
11
skin.json
11
skin.json
|
@ -25,9 +25,6 @@
|
|||
"MediaWiki": ">= 1.35.0"
|
||||
},
|
||||
"config": {
|
||||
"MinervaCountErrors": {
|
||||
"value": false
|
||||
},
|
||||
"MinervaDonateLink": {
|
||||
"value": {
|
||||
"base": true
|
||||
|
@ -247,13 +244,6 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"attributes": {
|
||||
"EventLogging": {
|
||||
"Schemas": {
|
||||
"WebClientError": 18340282
|
||||
}
|
||||
}
|
||||
},
|
||||
"ResourceModules": {
|
||||
"skins.minerva.base.styles": {
|
||||
"class": "ResourceLoaderSkinModule",
|
||||
|
@ -563,7 +553,6 @@
|
|||
"resources/skins.minerva.scripts/drawers.js",
|
||||
"resources/skins.minerva.scripts/ctaDrawers.js",
|
||||
"resources/skins.minerva.scripts/menu.js",
|
||||
"resources/skins.minerva.scripts/errorLogging.js",
|
||||
"resources/skins.minerva.scripts/preInit.js",
|
||||
"resources/skins.minerva.scripts/downloadPageAction.js",
|
||||
"resources/skins.minerva.scripts/page-issues/parser.js",
|
||||
|
|
Loading…
Reference in a new issue