Page MenuHomePhabricator

mobile-html: Error previewing edits for pages with slashes in the title in the Android app
Closed, ResolvedPublic

Description

A Hebrew Wikipedia user complained that he cannot edit pages in the user space using the app.

I can reproduce it in 2.7.50320-r-2020-05-20:

  • Open the Android app in the Hebrew Wikipedia.
  • Open the page משתמש:MathKnight/סקורפיון (מורטל קומבט) (link)
  • Edit.
  • Change one letter.
  • Save.

When I look at the diff, I see this:

{"type":"https://mediawiki.org/wiki/HyperSwitch/errors/not_found","title":"Not found.","method":"post","uri":"/he.wikipedia.org/v1/transform/wikitext/to/mobile-html/%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9%3AMathKnight%2F%D7%A1%D7%A7%D7%95%D7%A8%D7%A4%D7%99%D7%95%D7%9F_(%D7%9E%D7%95%D7%A8%D7%98%D7%9C_%D7%A7%D7%95%D7%9E%D7%91%D7%98)"}

When I try to publish, I see an AbuseFilter error.

When I try to do the same on the desktop, with the same account, everything works.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@bearND @Mholloway
I can reproduce this issue if the title contains a /.

Not sure if we should handle the / before sending the title to the API. For now, it will be encoded to %2F. (For example: User:Cooltey/AndroidNote => User%3ACooltey%2FAndroidNote)

Article like this: https://en.wikipedia.org/wiki//e/_(operating_system) will have the same issue.

Yes, page titles used as URL components should be URL-encoded before sending to any RESTBase (api/rest_v1/) API, otherwise you will see this problem.

It looks like this may already be fixed: https://github.com/wikimedia/apps-android-wikipedia/commit/a5b741ef5b00b4cbd09489e0c5cd48ccb972c82c

@cooltey did some more investigation, and it looks like this is actually a bug in the PCS /transform/wikitext/to/mobile-html code.

Compare

https://en.wikipedia.org/api/rest_v1/page/summary/%2Fdev%2Frandom

with

https://en.wikipedia.org/api/rest_v1/transform/wikitext/to/mobile-html/%2Fdev%2Frandom

My guess off the top of my head is that we're attempting to fetch wikitext from the Action API without accounting for title encoding.

Thanks @Mholloway.

Move this ticket to Blocked/Waiting to wait for the bug to be fixed by the Product Infrastructure team.

LGoto raised the priority of this task from Low to Medium.Jun 24 2020, 3:53 PM
JoeWalsh renamed this task from Error editing a page in the user space using the Android Wikipedia app to mobile-html: Error previewing edits for pages with slashes in the title in the Android app.EditedJun 30 2020, 4:44 PM
JoeWalsh raised the priority of this task from Medium to High.
JoeWalsh added subscribers: Charlotte, JoeWalsh.

Bumping priority to high and moving on to the kanban board based on conversation with @Charlotte and the Android team

eprodromou subscribed.

OK, retag us when the PR for Restbase is ready for review.

Hey @Mholloway and @MSantos - what's the status here? Do you still need @eprodromou's folks to review anything for you at this point?

Hey @Mholloway and @MSantos - what's the status here? Do you still need @eprodromou's folks to review anything for you at this point?

I'll double-check, but the related code is already merged, thanks for pinging us.

The code is reviewed but it looks like restbase needs to be deployed to include the related change here, retagging Platform Engineering

Mentioned in SAL (#wikimedia-operations) [2020-08-17T15:22:10Z] <ppchelko@deploy1001> Finished deploy [restbase/deploy@ddcecce]: T257943 T260556 T253478 T254490 T259054 (duration: 02m 30s)

Mentioned in SAL (#wikimedia-operations) [2020-08-17T15:22:25Z] <ppchelko@deploy1001> Started deploy [restbase/deploy@ddcecce]: T257943 T260556 T253478 T254490 T259054. take 2. feeds timed out

Mentioned in SAL (#wikimedia-operations) [2020-08-17T15:43:04Z] <ppchelko@deploy1001> Finished deploy [restbase/deploy@ddcecce]: T257943 T260556 T253478 T254490 T259054. take 2. feeds timed out (duration: 20m 40s)

Mentioned in SAL (#wikimedia-operations) [2020-08-17T15:43:12Z] <ppchelko@deploy1001> Started deploy [restbase/deploy@ddcecce]: T257943 T260556 T253478 T254490 T259054. take 3. feeds timed out

Mentioned in SAL (#wikimedia-operations) [2020-08-17T15:44:39Z] <ppchelko@deploy1001> Finished deploy [restbase/deploy@ddcecce]: T257943 T260556 T253478 T254490 T259054. take 3. feeds timed out (duration: 01m 31s)

The code is reviewed but it looks like restbase needs to be deployed to include the related change here, retagging Platform Engineering

Deployed. Please verify.

Seems good; re-tag us if it's not verified.

Thanks @Pchelolo and @eprodromou , I will leave it to @Charlotte to sign off. Seems good to me too.

ABorbaWMF subscribed.

I was able to publish an update to the article listed in the description. Looks good on 2.7.50330-alpha-2020-08-25

This seems to be resolved, please re-open if I'm missing something.