From c578db020da6607977471f263a400b77247c135c Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 13 Apr 2019 18:17:26 +0100 Subject: [PATCH] ext.uls.eventlogger: Remove use of mw.eventLog.logEvent() promise I guess the expectation was that for browsers that don't support Navigator.sendBeacon, the promise would wait for the 'new Image' fallback to complete. However, EventLogging never did that. In browsers where the Beacon API is not supported, 'new Image' starts asynchronously and either way the returned promise is immediately resolved. The only purpose of the returned promise was to detect errors in the format of the event (e.g. missing properties), which this code is not concerned with (given that it uses "always", not "done"). And besides, for that you'd probably want to use the EventLogging debug mode [1] instead. This is the last step before ULS can switch to a soft EL dependency by using mw.track instead, which I'll do in the next commit. Change-Id: If016b73dcd7320ddf1478c1678d2cc6371fe0fa1 --- resources/js/ext.uls.eventlogger.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/js/ext.uls.eventlogger.js b/resources/js/ext.uls.eventlogger.js index e1a216fc..3466d121 100644 --- a/resources/js/ext.uls.eventlogger.js +++ b/resources/js/ext.uls.eventlogger.js @@ -100,7 +100,8 @@ * @param {jQuery.Deferred} deferred */ function loginClick( deferred ) { - log( { action: 'login-click' } ).always( deferred.resolve ); + log( { action: 'login-click' } ); + deferred.resolve(); } /** @@ -126,7 +127,8 @@ interfaceLanguage: language }; - log( logParams ).always( deferred.resolve ); + log( logParams ); + deferred.resolve(); } /**