Page MenuHomePhabricator

[BUG] Drawer does not appear for block messages on mobile
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

The drawer which normally appears at the bottom of the screen (screenshot) when attempting to edit a page you are blocked from no longer appears.

It appears to start happening after this change: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/+/482385, part of task T149909.

It occurs on beta (1.34.0-alpha (6aacbeb)) and test (1.34.0-wmf.14 (33d3690)).

When attempting to edit a page you are blocked from, I don't see any likely errors or warnings in the javascript console.

I see an API request like: api.php?action=query&format=json&formatversion=2&prop=revisions%7Cinfo&rvprop=content%7Ctimestamp&titles=$article&intestactions=edit&intestactionsdetail=full&rvsection=0, which returns a JSON string like: P8782.

Steps to reproduce problem
  1. Use Special:Block to block $user
  2. Login as $user
  3. At the bottom of the page, click "Mobile view"
  4. Go to an article you are blocked from and click the pen icon to attempt to edit

Expected behavior: Drawer appears with the block details (as in screenshot)
Observed behavior: Page reloads, but nothing appears to happen

Screenshots (if applicable):

Developer notes

Can be replicated with

diff --git a/src/mobile.editor.overlay/EditorGateway.js b/src/mobile.editor.overlay/EditorGateway.js
index 034e6eca4..562b57867 100644
--- a/src/mobile.editor.overlay/EditorGateway.js
+++ b/src/mobile.editor.overlay/EditorGateway.js
@@ -95,14 +95,17 @@ EditorGateway.prototype = {
 			if ( util.isNumeric( this.sectionId ) ) {
 				options.rvsection = this.sectionId;
 			}
-			return this.api.get( options ).then( function ( resp ) {
+			return $.Deferred().resolve( {"batchcomplete":true,"warnings":{"main":{"warnings":"Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes. Use [[Special:ApiFeatureUsage]] to see usage of deprecated features by your application."},"revisions":{"warnings":"Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."}},"query":{"pages":[{"pageid":49877,"ns":0,"title":"Spam","revisions":[{"timestamp":"2009-06-20T12:07:26Z","contentformat":"text/x-wiki","contentmodel":"wikitext","content":"Hello, World! (Bot test; should be reverted in about one minute)"}],"contentmodel":"wikitext","pagelanguage":"en","pagelanguagehtmlcode":"en","pagelanguagedir":"ltr","touched":"2012-11-02T18:54:26Z","lastrevid":75276,"length":64,"new":true,"actions":{"edit":[{"code":"blocked","text":"You have been blocked from editing.","data":{"blockinfo":{"blockid":18003,"blockedby":"Dom walden","blockedbyid":42287,"blockreason":"","blockedtimestamp":"2019-07-15T08:04:52Z","blockexpiry":"infinite","blockpartial":false}}}]}}]}})
+			.then( function ( resp ) {
 				var revision, pageObj;
+				console.log('resp', resp.error);
 
 				if ( resp.error ) {
 					return util.Deferred().reject( resp.error.code );
 				}
 
 				pageObj = resp.query.pages[0];
+				console.log('resp', pageObj);
 				// page might not exist and caller might not have known.
 				if ( pageObj.missing !== undefined ) {
 					self.content = '';
@@ -115,6 +118,7 @@ EditorGateway.prototype = {
 				// save content a second time to be able to check for changes
 				self.originalContent = self.content;
 				self.blockinfo = self.getBlockInfo( pageObj );
+				console.log(self.blockinfo);
 
 				return resolve();
 			} );

Details

Related Gerrit Patches:
mediawiki/extensions/MobileFrontend : masterBlockMessage: Fix order of buttons
mediawiki/extensions/MobileFrontend : masterBlockMessage.postRender needs to call super

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 23 2019, 9:45 AM
Jdrewniak triaged this task as High priority.Jul 24 2019, 11:09 AM
Jdrewniak added a subscriber: ovasileva.
Jdlrobson moved this task from Incoming to Needs Prioritization on the Readers-Web-Backlog board.
Jdlrobson added a subscriber: Jdlrobson.

Pinging VisualEditor and Anti-Harrassment team to let them know this is likely broken. Next step lets' work out what happened.

Restricted Application added a subscriber: MGChecker. · View Herald TranscriptJul 24 2019, 3:52 PM
Jdlrobson updated the task description. (Show Details)Jul 24 2019, 6:12 PM
Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptJul 24 2019, 6:12 PM

Change 525338 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] BlockMessage.postRender needs to call super

https://gerrit.wikimedia.org/r/525338

Fix is pretty straightforward - but need a reviewer + a product owner to prioritise.

Change 525338 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] BlockMessage.postRender needs to call super

https://gerrit.wikimedia.org/r/525338

matmarex added a subscriber: matmarex.

I guess I can pull it on our workboard…

@dom_walden: Could you check if the fix is working for you?

@dom_walden: Could you check if the fix is working for you?

The drawer appears for me now on Chromium 73 on https://en.m.wikipedia.beta.wmflabs.org/wiki (version 1.34.0-alpha (65f59d1) 14:51, 27 July 2019).

The only thing I notice is that the order of "Details" and "OK" are incorrect (compared to how they were previously). If you like, I can just raise a separate bug for this.

Thanks!

Change 526004 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/MobileFrontend@master] BlockMessage: Fix order of buttons

https://gerrit.wikimedia.org/r/526004

The only thing I notice is that the order of "Details" and "OK" are incorrect (compared to how they were previously). If you like, I can just raise a separate bug for this.

Please. :)

Change 526004 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] BlockMessage: Fix order of buttons

https://gerrit.wikimedia.org/r/526004

The only thing I notice is that the order of "Details" and "OK" are incorrect (compared to how they were previously). If you like, I can just raise a separate bug for this.

Please. :)

Actually, I guess it is not necessary as the latest patch has just fixed it :).

Change 526004 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] BlockMessage: Fix order of buttons
https://gerrit.wikimedia.org/r/526004

ppelberg closed this task as Resolved.Sep 2 2019, 11:59 PM
ppelberg claimed this task.
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptSep 2 2019, 11:59 PM