Page MenuHomePhabricator

Update MobileFrontend for changes in AbuseFilter and SpamBlacklist API error responses
Open, Needs TriagePublic

Description

API error responses generated by AbuseFilter and SpamBlacklist have changed, as announced here: https://lists.wikimedia.org/pipermail/mediawiki-api-announce/2019-September/000148.html (relevant task: T229539).

It appears you have special handling for the old responses. It should be updated, otherwise they will probably show a generic error message instead of a more specific one.

extensions/MobileFrontend/src/mobile.editor.overlay/AbuseFilterOverlay.js:
    9:  * is related to the abusefilter extension.
   17: 			className: 'overlay abusefilter-overlay'

extensions/MobileFrontend/src/mobile.editor.overlay/AbuseFilterPanel.js:
    7:  * Panel that shows an error message related to the abusefilter extension.
   36: 		readMoreMsg: mw.msg( 'mobile-frontend-editor-abusefilter-read-more' )
   44: 	<p></p><a href="#/abusefilter" class="readmore">{{readMoreMsg}}</a>
   58: 		this.overlayManager.add( /^\/abusefilter$/, function () {
   65: 			msg = mw.msg( 'mobile-frontend-editor-abusefilter-warning' );
   67: 			msg = mw.msg( 'mobile-frontend-editor-abusefilter-disallow' );

extensions/MobileFrontend/src/mobile.editor.overlay/EditorOverlayBase.js:
  285: 				'abusefilter-disallowed': 'extensionAbuseFilter',

extensions/MobileFrontend/src/mobile.editor.overlay/parseSaveError.js:
   48: 			if ( /^abusefilter-warning/.test( code ) ) {
   51: 					type: 'abusefilter',
   57: 			} else if ( /^abusefilter-disallow/.test( code ) ) {
   60: 					type: 'abusefilter',
   66: 			} else if ( /^abusefilter/.test( code ) ) {
   69: 					type: 'abusefilter',

extensions/MobileFrontend/src/mobile.editor.overlay/SourceEditorOverlay.js:
  527: 		} else if ( data.type === 'abusefilter' ) {

extensions/MobileFrontend/tests/node-qunit/mobile.editor.overlay/EditorGateway.test.js:
  152: 					code: 'abusefilter-warning-usuwanie-tekstu',
  162: 					code: 'abusefilter-disallow',
  172: 					code: 'abusefilter-something',
  465: 				type: 'abusefilter',
  489: 				type: 'abusefilter',
  513: 				type: 'abusefilter',

Event Timeline

Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptWed, Sep 11, 10:44 PM

I will have a look at this one, I want to ditch a lot of this code as part of T228897/T202460 anyway…