Page MenuHomePhabricator

Block message not shown when a temporary account is blocked on mobile
Open, Needs TriagePublic

Description

Steps to reproduce
  1. Block an IP address
  2. On mobile, try to edit (logged out) from the IP address, with temp accounts enabled

Expected: See a block message
Actual: Progress to the editor; on saving an edit, a block error message is shown

(The same behaviour occurs if you block the temp account directly.)

Notes

At first I thought this was similar to T227167: Block notice is not shown when editing from mobile for composite blocks, in which case blockedtext-tempuser needed to be registered with ApiBase::BLOCK_CODE_MAP. However, doing this in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/999075 didn't solve the problem.

It also happens when a temporary user is partially blocked, in which case they get the same message as a registered user, so it doesn't seem to be related to the message key. (Registered users see the block message correctly.)

Event Timeline

Tchanders renamed this task from Show block message on to Block message not shown when a temporary account is blocked on mobile.Feb 8 2024, 8:47 PM
Tchanders created this task.

@Tchanders let me know if you need help from the web team. Although it doesn't look like any of the related code here is maintained by us, happy to find you any help you might need to support you on this one!

Thanks @Jdlrobson

I assumed it was to do with the workflow where the temp user notice is shown, which I don't believe we added:

image.png (270×940 px, 27 KB)

We'll can look further into it when we have some time, unless you get there first!

Got it! I hadn't understood this was about MobileFrontend. This code is dual-maintained by web and editing team (it's one of our gray areas of ownership :-)).

We already have a component for BlockMessageDetails at https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/src/mobile.editor.overlay/BlockMessageDetails.js so I think if pass block details to createAnonWarning in https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/src/mobile.editor.overlay/EditorOverlayBase.js#L576 it should be straightforward to render something here.

My assumption was we opened a BlockMessageDrawer though when we detected someone was blocked and never showed the editor:
https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blame/master/src/mobile.editor.overlay/blockMessageDrawer.js
Perhaps there is something wrong in the logic here?:
https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/0c650ed156e89857143be6d9bf8e45909e2c6eac/src/mobile.init/editor.js#L408