Jdlrobson has submitted this change and it was merged.

Change subject: Remove event logging for Commons CentralAuth image errors
......................................................................


Remove event logging for Commons CentralAuth image errors

Now userlogin.js is loaded at the top of the page to issue a redirect to
Commons as quickly as possible, so we can't assume that
mf-application.js needed for EL (getSessionId()) is loaded.

Change-Id: I60ecaacfc053167eae75b8b37a729ec43a15e265
---
M javascripts/specials/userlogin.js
1 file changed, 7 insertions(+), 28 deletions(-)

Approvals:
  Jdlrobson: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/javascripts/specials/userlogin.js 
b/javascripts/specials/userlogin.js
index 1767e42..b49a72d 100644
--- a/javascripts/specials/userlogin.js
+++ b/javascripts/specials/userlogin.js
@@ -1,5 +1,5 @@
 // FIXME: temporary hack to make sure we log into Commons
-( function( M, $ ) {
+( function( $ ) {
        var loginHandshakeUrl = mw.config.get( 'wgMFLoginHandshakeUrl' );
 
        // using feature detection used by 
http://diveintohtml5.info/storage.html
@@ -24,43 +24,22 @@
                        $( '#mw-returnto' ).addClass( 'loaded' );
                }
 
-               function error() {
-                       M.log( 'MobileWebCentralAuthError', {
-                               token: M.getSessionId(),
-                               mobileMode: mw.config.get( 'wgMFMode' ),
-                               userAgent: window.navigator.userAgent,
-                               error: 'commonsImageError'
-                       } );
-                       // show the return to link anyway after logging the 
event
-                       done();
-               }
-
-               // define event logging schema here until
-               // https://gerrit.wikimedia.org/r/#/c/52053/ is merged and/or 
we properly
-               // track dependencies for event logging schemas
-               if ( mw.eventLog ) {
-                       mw.eventLog.setSchema("MobileWebCentralAuthError", 
{"schema":{"properties":{"token":{"type":"string","required":true,"description":"User
 
token"},"error":{"type":"string","required":true,"enum":["commonsImageError"],"description":"Kind
 of error. commonsImageError - when CentralAuth Commons image failed to load 
(detected in 
JavaScript)"},"mobileMode":{"type":"string","required":true,"enum":["stable","beta","alpha"],"description":"Whether
 the user is seeing the regular non-beta, beta, or alpha version of the mobile 
site."},"userAgent":{"type":"string","description":"Useragent 
string."}}},"revision":5294684});
-               }
-
                // make sure Commons image is loaded after login
                if ( $commonsImage.length ) {
                        // http://stackoverflow.com/a/3877079/365238
                        $commonsImage.
                                one( 'load', done ).
-                               on( 'error', error ).
+                               // show the return to link anyway even if image 
fails to load
+                               one( 'error', done ).
                                each( function() {
-                               if ( this.complete ) {
-                                       // 
http://stackoverflow.com/a/1977898/365238
-                                       if ( this.naturalWidth === 0 ) {
-                                               error();
-                                       } else {
+                                       if ( this.complete ) {
+                                               // 
http://stackoverflow.com/a/1977898/365238
                                                done();
                                        }
-                               }
-                       } );
+                               } );
                } else {
                        done();
                }
        } );
 
-}( mw.mobileFrontend, jQuery ) );
+}( jQuery ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/56067
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I60ecaacfc053167eae75b8b37a729ec43a15e265
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to