From 29bfece9583f72cb4337a57d3b6033ac7170cdb3 Mon Sep 17 00:00:00 2001 From: Jdlrobson Date: Mon, 11 Feb 2019 18:11:16 +0000 Subject: [PATCH] Revert "Hygiene: Track minerva errors count only once" We talked about this in standup today and given Sam's comment in T212970#4943448 and a potential loss of data, we've considered this a little risky and would like to revert and discuss this. We can reapply the patch later if necessary. This reverts commit a486bde329e365dc41f2ec6ac3a85da7fd3e873a. Bug: T212970 Change-Id: I0aad3937dde92bf7a46df8c1cf892bf5ce257e17 --- resources/skins.minerva.scripts/errorLogging.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/resources/skins.minerva.scripts/errorLogging.js b/resources/skins.minerva.scripts/errorLogging.js index a7b7ce9cf..8bbd90e99 100644 --- a/resources/skins.minerva.scripts/errorLogging.js +++ b/resources/skins.minerva.scripts/errorLogging.js @@ -1,10 +1,5 @@ ( function ( M, requestIdleCallback, track, config, trackSubscribe, user, experiments ) { requestIdleCallback( function () { - /** - * Errors count in the current pageview - * @type {number} - */ - var errorsCount = 0; /** * Handle an error and log it if necessary * @param {string} errorMessage to be logged @@ -35,7 +30,7 @@ isAnon: user.isAnon(), revision: page.getRevisionId() }; - errorsCount++; + if ( isErrorLoggingEnabled ) { track( EVENT_CLIENT_ERROR_LOG, util.extend( { @@ -50,10 +45,8 @@ }, DEFAULT_ERROR_DATA ) ); } - } - function logErrorsCount() { - if ( errorsCount > 0 ) { - mw.track( 'counter.MediaWiki.minerva.WebClientError', errorsCount ); + if ( config.get( 'wgMinervaCountErrors' ) ) { + mw.track( 'counter.MediaWiki.minerva.WebClientError', 1 ); } } // track RL exceptions @@ -65,9 +58,6 @@ trackSubscribe( 'global.error', function ( topic, error ) { handleError( error.errorMessage, error.lineNumber, error.columnNumber, error.url ); } ); - if ( config.get( 'wgMinervaCountErrors' ) ) { - $( window ).on( 'beforeunload', logErrorsCount ); - } } ); }( mw.mobileFrontend,