Page MenuHomePhabricator

Watchlist Expiry: prop=info&inprop=watched should show some indication of expiry
Closed, ResolvedPublic3 Estimated Story PointsFeature

Description

Sort of similar to T263796 and T254141, but when querying a page's watched status with prop: 'info' and inprop: 'watched', I'd expect a page with an expiry to be distinguishable, ideally by also providing the expiry itself.

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptNov 26 2020, 3:00 PM
Amorymeltzer changed the subtype of this task from "Task" to "Feature Request".Nov 26 2020, 3:01 PM

To clarify (@DannyS712 you might be able to correct me if I'm wrong) without this, I don't think there's a reliable way to get watchlist expiry status for a given page? T263796 helps but wouldn't cover it.

@MusikAnimal Hello! How many points would you estimate this ticket to be?

Change 649736 had a related patch set uploaded (by MusikAnimal; owner: MusikAnimal):
[mediawiki/core@master] [WIP] ApiQueryInfo: Return watchlist expiry instead of true

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

ifried set the point value for this task to 3.Dec 15 2020, 11:53 PM

Change 649736 merged by jenkins-bot:
[mediawiki/core@master] ApiQueryInfo: Return watchlist expiry when applicable for inprop=watched

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

dom_walden added a subscriber: dom_walden.

When looking up information for a page via the api, you can now return the watch expiry.

For example, https://en.wikipedia.beta.wmflabs.org/wiki/Special:ApiSandbox#action=query&format=json&prop=info&titles=Foobar&inprop=watched

The response if the page is temporarily watched is something like:

{
    "title": <title>,
    ...
    "watched": "",
    "watchlistexpiry": "2021-07-11T08:59:22Z"
}

If it is watched permanently, the response is like:

{
    "title": <title>,
    ...
    "watched": ""
}

This change slightly re-wrote a function used elsewhere. I tested other parts of the code which use this function. I did not find any problems.

Test Environment https://en.wikipedia.beta.wmflabs.org MediaWiki 1.36.0-alpha (90996aa) 07:32, 11 January 2021.

Just to confirm @MusikAnimal, am I right that this change has also tweaked (corrected?) the return value of watched when using format=json&formatversion=2? Without this change, a title I'm not watching returns "watched": false while after this change, it does not return watched. That's seems more correct, but just wanted to confirm since it wasn't mentioned.

Just to confirm @MusikAnimal, am I right that this change has also tweaked (corrected?) the return value of watched when using format=json&formatversion=2? Without this change, a title I'm not watching returns "watched": false while after this change, it does not return watched. That's seems more correct, but just wanted to confirm since it wasn't mentioned.

The intention was to not change any long-standing behaviour. But it looks the fix at https://gerrit.wikimedia.org/r/c/mediawiki/core/+/655665 restored the "watched":false, so we're good :) With this API, you have to pass in inprop=watched to get any watch info, so I think it's appropriate to always return a value for watched (since you're explicitly asking for it).

This is now on production, and we're not experiencing errors. Also, I am seeing the same behavior, as described by Dom, when I test on production. For these reasons, I'm marking this as Done.