Page MenuHomePhabricator

CAPTCHAs are no longer served to mobile users, causing a generic error instead
Closed, ResolvedPublic

Description

Some anonymous users reported this issue on it.wiki, which makes it impossible to add a source with their edits. The same thing happens on en.wiki and test2.wiki.

Steps to Reproduce:

  1. Be sure you are logged-out;
  2. Switch to mobile view;
  3. Edit any page providing a website URL and try to save it.

Actual Result: The generic Error, edit not saved. message is shown and the changes are not saved.

Expected result: A CAPTCHA should be prompted to the user to prevent spam, but after solving it the edit should saved, like it correctly happens in desktop mode.

Event Timeline

Titore created this task.Feb 2 2019, 2:20 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 2 2019, 2:20 PM
Sakretsu triaged this task as Unbreak Now! priority.Feb 2 2019, 3:15 PM
Sakretsu added a subscriber: Sakretsu.

Feel free to lower priority, but probably we are losing a large amount of contributions from mobile users due to this bug.

Restricted Application added subscribers: Liuxinyu970226, TerraCodes. · View Herald TranscriptFeb 2 2019, 3:15 PM
Tgr added a subscriber: Tgr.Feb 2 2019, 8:55 PM

Confirmed. The captcha panel does get loaded but but does not get unhidden. Not sure what could cause it given this is a non-deploy week.

pmiazga added a comment.EditedFeb 5 2019, 3:13 AM

Confirmed, and I see two issues here:
A) Captcha is filled in, but not visible in Wikitext editor, in visual editor it works properly.

This got introduced in https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/MobileFrontend/+/478970/ (please see results of my investigation here: https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/MobileFrontend/+/478970/4/resources/mobile.editor.overlay/EditorOverlay.js). In short we show the captcha,
and then immediately hide it to present the error message.

B) Additionally, there is another problem with AbuseFilter extension, when I get rejected by the AbuseFilter I see only the default Error, edit not saved. message.
The easiest way to reproduce is to edit some user page with not logged-in account, we immediately get rejected by AbuseFilter, rule 803.
The user has no idea what caused the error to fail, as only generic error message is present.

Change 488064 had a related patch set uploaded (by DLynch; owner: DLynch):
[mediawiki/extensions/MobileFrontend@master] EditorOverlay: captcha/abusefilter weren't being shown correctly

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

DLynch claimed this task.Feb 5 2019, 2:30 PM

We should backport to wmf.14

Change 488064 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] EditorOverlay: captcha/abusefilter weren't being shown correctly

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

Change 488117 had a related patch set uploaded (by Bartosz Dziewoński; owner: DLynch):
[mediawiki/extensions/MobileFrontend@wmf/1.33.0-wmf.14] EditorOverlay: captcha/abusefilter weren't being shown correctly

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

Change 488117 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@wmf/1.33.0-wmf.14] EditorOverlay: captcha/abusefilter weren't being shown correctly

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

Mentioned in SAL (#wikimedia-operations) [2019-02-06T00:33:52Z] <niharika29@deploy1001> Synchronized php-1.33.0-wmf.14/extensions/MobileFrontend/: EditorOverlay: captcha/abusefilter weren't being shown correctly T215101, T202374 (duration: 00m 50s)

Jdlrobson added a subscriber: Jdlrobson.

This looks fixed to me. Not sure if editing team would like to do any testing so leaving resolving this task to them.

Ryasmeen added a subscriber: Ryasmeen.EditedFeb 13 2019, 1:01 AM

@DLynch/@matmarex: I am still seeing this issue on beta and test2. On en.wiki, it did not prompt for any CAPTCHA when I added an external link for the first time in a session but after that for subsequent sessions it did.

Esanders moved this task from Inbox to High Priority on the Editing QA board.Feb 13 2019, 6:46 PM
matmarex moved this task from Stalled/Waiting to QA on the VisualEditor (Current work) board.

On en.wiki, it did not prompt for any CAPTCHA when I added an external link for the first time in a session but after that for subsequent sessions it did.

If an identical link was already present on the page, you wouldn't get a CAPTCHA. This seems to be the likely explanation for a testing page.

@DLynch/@matmarex: I am still seeing this issue on beta and test2.

Okay, we definitely messed up the patch…

In change 488064, only the file src/mobile.editor.overlay/EditorOverlay.js was changed, but that file is not actually used! The file which is used is resources/dist/mobile.editor.overlay.js, generated from the other one via Webpack. That file was not updated (we forgot to run Webpack and commit the results). When the patch was cherry-picked to change 488117 and deployed, it had no effect.

resources/dist/mobile.editor.overlay.js was updated in the next commit to the repository, change 487973. You can see the missing change applied in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/+/487973/6/resources/dist/mobile.editor.overlay.js (search for "saveFailureMessage").

David and I are to blame for not noticing this, but in my opinion there should be an automated check to prevent this mistake. I filed T216449 about this.


Change 487973 was in wmf.16, which has been deployed to all of the wikis by now, so the issue should now really be fixed with no further action needed. Can you verify it again?

When the patch was cherry-picked to change 488117 and deployed, it had no effect.

Correction, spotted by David:

Actually! Because this was backported to this branch, which was before the editor code was ported to webpack, this worked fine. It's the non-backported version which was a no-op.

@matmarex: Just re-checked this on test wiki which is running wmf.18 right now. Still seems broken to me.

Since at least February 12 I cannot reproduce the Error, edit not saved. that I reported. My steps were simply typing "Test https://www.google.com" while logged-out, and now the captcha is indeed shown with no error. Not sure if you're testing some more use cases though.

ok it seems to be working for me now.

Is there anything left to do?

ppelberg closed this task as Resolved.Feb 26 2019, 9:18 PM
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptFeb 26 2019, 9:18 PM