mediawiki-extensions-Visual.../modules/ve-mw/init
Bartosz Dziewoński 33bbd5bcf2 Remove duplicate load error handling code
Load errors are already handled in the MobileFrontend part of the
mobile visual editor, by this code:

66c55573e5/src/mobile.init/editor.js (L375-L387)

    // Wait for the data to load before we show the editor overlay
    overlay.getLoadingPromise().then( function () {
    	...
    }, function ( error, apiResponse ) {
    	// Could not load the editor.
(1) 	overlayManager.router.back();
    	if ( error.show ) {
    		// Probably a blockMessageDrawer returned because the user is blocked.
    		document.body.appendChild( error.$el[ 0 ] );
    		error.show();
    	} else if ( apiResponse ) {
(2) 		mw.notify( editorOptions.api.getErrorMessage( apiResponse ) );
    	} else {
    		mw.notify( mw.msg( 'mobile-frontend-editor-error-loading' ) );
    	}
    } );

Compared to our code:

    ve.init.mw.MobileArticleTarget.prototype.loadFail = function ( code, errorDetails ) {
    	...
(1) 	this.overlay.onExitClick( $.Event() );
(2) 	mw.notify( this.extractErrorMessages( errorDetails ) );
    };

The lines marked with (1) and (2) do basically the same thing. And
the function parameters "error, apiResponse" and "code, errorDetails"
are actually the same objects, just with confusingly different names.

This causes the popup with error message to appears twice (although it
isn't too obvious, since the two popups appear in the same place, so
only one is visible), and also causes bogus data to be sent in event
logging (T237063).

Bug: T237063
Change-Id: I7fe7a944707fe585251ce9e16bbb78ccd123a7ed
2021-10-11 23:20:43 +02:00
..
apiresponsecache Remove redundant initialization from LinkCache 2021-09-02 13:54:15 +02:00
styles Make .ve-init-mw-target-surface styles not apply to nested non-target surfaces 2021-06-04 20:48:18 +00:00
targets Remove duplicate load error handling code 2021-10-11 23:20:43 +02:00
ve.init.mw.ArticleTargetEvents.js Update save failure logging for EditAttemptStep schema, simplify code 2021-01-15 20:06:20 +01:00
ve.init.mw.js build: Update eslint-config-wikimedia to 0.16.0 2020-06-02 21:30:00 +01:00
ve.init.mw.Platform.init.js doc: Bump copyright year for 2020 2020-01-08 09:13:24 -08:00
ve.init.mw.Platform.js Merge "Implement mwPlatform#decodeEntities" 2021-01-28 20:57:40 +00:00
ve.init.mw.SaveErrorHandler.js Remove @param/@return docs that literally repeat the code 2021-06-14 15:44:51 +02:00
ve.init.mw.trackSubscriber.js Track whether an event was oversampled 2021-02-02 13:02:01 +01:00
ve.init.mw.ViewportZoomHandler.js doc: Bump copyright year for 2020 2020-01-08 09:13:24 -08:00