This piece of code makes it very difficult to support a multi-lingual app.
I'd like to understand the reasoning behind it and explore whether it can be removed.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Remove some DOM transforms for new endpoints | mediawiki/services/mobileapps | master | +136 -137 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | None | T169242 Develop Page Content Service for Reading Clients | |||
Duplicate | None | T146944 Mobile-sections replacement | |||
Resolved | • bearND | T147043 Do not rewrite urls via _rewriteUrlAttribute in new endpoint |
Event Timeline
This was done so we didn't have to change the Android app's link handler when moving from action=mobileview. I believe @Mholloway had a patch of two to change this to not have to do the rewrite anymore. The reason we didn't go forward with that is that it would break existing Android app versions. We could, however, drop the rewrite or URLs when we make other backward-breaking changes and use a new version or new endpoint.
@Mholloway I had a hard time finding the other task and patches. Feel free to link them here.
Cool. Let's make this part of the new sections endpoint then.
It's really useful to be able to support this use case:
https://trending.wmflabs.org/en.wiktionary/Special:Search/Spiders
Yeah, I had stopped this rewriting in the first draft of one of my patches after the mobileapps service security review, but took it out because it wasn't necessary or strictly related, and more importantly, as Bernd mentioned, it would break existing clients.
Now that we have content format versioning I'm all for getting rid of URL rewriting.
I also have an abandoned app-side patch to handle both internal URL format variants that I could revive when the time comes.
Sweet.
Is there a way we can do this for the experimental endpoint without breaking caching? (I don't understand your stack that well.)
There's one edge case I haven't worked out how to deal with in the MobileFrontend web app - Main Page. Here the URL is '/' so any links rendered by it break. I guess at this point its up to the renderer to deal with.
An alternative would be to adopt a new url pattern inside articles e.g. /project/en.wikipedia/Title
Change 348860 had a related patch set uploaded (by BearND):
[mediawiki/services/mobileapps@master] Remove some DOM transforms for new endpoints
Change 348860 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Remove some DOM transforms for new endpoints