Page MenuHomePhabricator

Allow action=watch api to rely on user preferences
Open, Needs TriagePublic


Using the API to edit (or protect, delete, etc.) a page, the watchlist parameter supports (since T24944) the following options: nochange, preferences, watch, and unwatch. The watch action, however, allows only a boolean, seemingly parallel to the deprecated watch/unwatch parameters from T24944.

As an example, I use the API to edit a subpage of another page. I want to watch that subpage based on my preferences, but I also want to watch the parent page based on those same preferences. I have to do something like !!parseInt(mw.user.options.get('watchdefault'), 10) or (more appropriately) wait for the edit to go through then check the response for watched.

It would be cleaner to have the option available in the API itself.

I'm putting this up because I think it'd be useful, but I suspect there's little appetite for it. For one, it's unlikely that watchdefault is always the preference that should be observed, so needing to select which preference be obeyed would be a pain. The above options are fine enough for most purposes I can imagine.

Event Timeline

Restricted Application added a project: Platform Engineering. · View Herald TranscriptSep 15 2020, 10:51 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript