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
This commit is contained in:
@@ -100,7 +100,8 @@
|
|||||||
* @param {jQuery.Deferred} deferred
|
* @param {jQuery.Deferred} deferred
|
||||||
*/
|
*/
|
||||||
function loginClick( deferred ) {
|
function loginClick( deferred ) {
|
||||||
log( { action: 'login-click' } ).always( deferred.resolve );
|
log( { action: 'login-click' } );
|
||||||
|
deferred.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -126,7 +127,8 @@
|
|||||||
interfaceLanguage: language
|
interfaceLanguage: language
|
||||||
};
|
};
|
||||||
|
|
||||||
log( logParams ).always( deferred.resolve );
|
log( logParams );
|
||||||
|
deferred.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user