ext.uls.eventlogger: Remove more obsolete deferred complexity
Follows-upc578db02andea671b1f, which I thought removed all code relating to the old async EventLogging method. I didn't notice this UI code at the time, because I only took a single pass over the code to find dead code. Now that that code is gone, it is clear that the UI code is also redundant. The mw.track() and logEvent() methods don't track the Beacon API's async fetches, which also isn't needed, since the loss of browser context upon navigation doesn't abort background beacons. The loading of the EL library itself is already ensured via a dependency so we already know there won't be an async fetch for that. What that leaves is some portion of older browsers in which a EventLogging falls back to 'new Image'. This is basically just IE 11 per <https://caniuse.com/beacon>, and for those some portion of events will have been lost since EventLogging removed support two+ years ago for tracking those fallback fetches via a Promise (because of the perf issues caused by what the removed code here was able to do). Change-Id: Idf4378f983b6ba0e755ebadb97aa6d87cf95f7a5
This commit is contained in:
@@ -192,21 +192,12 @@
|
||||
dir: 'auto'
|
||||
} )
|
||||
.on( 'click', function ( event ) {
|
||||
var deferred = $.Deferred();
|
||||
// Track if event logging is enabled
|
||||
mw.hook( 'mw.uls.language.revert' ).fire();
|
||||
|
||||
event.preventDefault();
|
||||
deferred.done( function () {
|
||||
mw.loader.using( [ 'ext.uls.common' ] ).then( function () {
|
||||
mw.uls.changeLanguage( event.target.lang );
|
||||
} );
|
||||
mw.loader.using( [ 'ext.uls.common' ] ).then( function () {
|
||||
mw.uls.changeLanguage( event.target.lang );
|
||||
} );
|
||||
|
||||
mw.hook( 'mw.uls.language.revert' ).fire( deferred );
|
||||
|
||||
// Delay is zero if event logging is not enabled
|
||||
setTimeout( function () {
|
||||
deferred.resolve();
|
||||
}, mw.config.get( 'wgULSEventLogging' ) * 500 );
|
||||
} );
|
||||
|
||||
if ( mw.storage.get( 'uls-gp' ) === '1' ) {
|
||||
|
||||
Reference in New Issue
Block a user