Page MenuHomePhabricator

Page previews show last revision instead of flagged revision
Closed, ResolvedPublic

Description

Screenshot_2021-04-02_170435.jpg (223×865 px, 49 KB)

Screenshot_2021-04-02_171527.jpg (653×2 px, 268 KB)

Since the last revision may contain vandalism and is not shown by default to the users when flaggedrevs are enabled, this may lead to confusion.

Event Timeline

Tacsipacsi subscribed.

The screenshot shows the Page previews feature, not Navigation Popups. While Navigation Popups may also be affected, it’s a power user tool, so eventual vandalism doesn’t seem to be an issue for me there. Page previews, on the other hand, is aimed at readers and should be fixed.

Tacsipacsi renamed this task from Navigation Popups show last revision instead of flagged revision to Page previews show last revision instead of flagged revision.Apr 7 2021, 2:23 AM
Jdlrobson subscribed.

Page previews uses an API to access this data, so issue sits inside FlaggedRevs or that API.

Considering Flagged Revision description (link - https://en.wikipedia.org/wiki/Wikipedia:Flagged_revisions) not all wikis use it.
For those wikis, that have FlaggedRevs, related API helps to retrieve more information for current and stable revisions. Example for German wiki:
https://de.wikipedia.org/w/api.php?action=query&prop=info|flagged&titles=sandbox

There are stable_revid and lastrevid properties. If the article has been changed recently, lastrevid will point to the current version.

We tried to solve this issue on mobileapps level since it has API request to /summary endpoint which is needed for popups.
Though it is possible to get flagged revision by adding helper mw api request, there is still old tid property that is exposed on the RESTBase and itself is a part of response ETag.
Passing incorrect tid in its turns might lead to the cache issues inside RESTBase while page revision lookup. We need to come up to a feasible solution here without major RESTBase refactoring since it's deprecation.

cc: @Jgiannelos , @MSantos

Change 821218 had a related patch set uploaded (by Vadim Kovalenko; author: Vadim Kovalenko):

[mediawiki/services/mobileapps@master] Page previews show last revision instead of flagged revision

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

I've uploaded the patch to resolve flagged revisions (only for the German wiki for now). Useful links:

  1. Pending review pages ('de' wiki): https://de.wikipedia.org/wiki/Spezial:Seiten_mit_ungesichteten_Versionen
  2. MW API example to check flagged rev property (flagged.stable_revid) for one of the articles from the list above (it is dynamic, so the title might be disappeared later): https://de.wikipedia.org/w/api.php?action=query&prop=info%7Cflagged&titles=EN_81346

Note: some pages with namespaces may not have flagged.stable_revid (example), this setting is defined by $wgFlaggedRevsNamespaces property in the extension settings itself (docs)

Even mainspace pages may not have flagged.stable_revid, in case they haven’t been reviewed ever (example—this is from beta, but there are such pages on production Wikipedia as well, I just don’t want to advertise them as they’re potential vandalism targets). Your patch seems to handle this case as well.

it is dynamic, so the title might be disappeared later

Unless it’s deleted, it won’t disappear. Compare with info about the Berlin article, which has no pending changes—the query.pages[*].flagged object is still there, only the pending_since is missing, and flagged.stable_revid is the same as lastrevid.


What does your patch affect? It’s in a repo named mobileapps, while the original report was about Page Previews, a desktop browser feature.

@Tacsipacsi , thank you for the extra info!

What does your patch affect? It’s in a repo named mobileapps, while the original report was about Page Previews, a desktop browser feature.

Page Previews extension relies on the response of the /summary endpoint which is handled inside mobileapps service.

Page Previews extension relies on the response of the /summary endpoint which is handled inside mobileapps service.

Okay, thanks! I was hoping that it’s just the confusing naming.

Change 821218 merged by jenkins-bot:

[mediawiki/services/mobileapps@master] Page previews: show flagged revision instead of latest

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

Has this been deployed? With a quick check, it doesn’t seem to work: if I hover over the link of ColorStar in the article hu:Pécsi Egyetemi Napok, I should see A ColorStar egy magyar elektronikus zenekar… (stable version), but I see A ColorStar egy magyar pszichedelikus-elektronikus tánczenekar… (latest version).

After a purge of the page this is what i see:

image.png (540×960 px, 121 KB)

I think its a matter of content being stored on restbase that will eventually get invalidated

Ah, okay, didn’t think about caching. Thanks for the explanation!