Page MenuHomePhabricator

VisualEditor failed to save watch duration due to a wrong POST key
Closed, DuplicatePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Edit with the VisualEditor
  • Before submitting the edit, set the watching duration to anything but no and infinity

What happens?: The page is watched, but the duration is not set - it is watched indefinitely.

What should have happened instead?: The page should be watched for the set duration, not forever.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia): WMF site, at least on zhwiki, not tested elsewhere reproducable on enwiki and arywiki

Other information (browser name/version, screenshots, etc.):

Some technical investigation, correct me if I am wrong:

  1. The checkbox with the class ve-ui-mwSaveDialog-checkbox-wpWatchlistExpiry is created.
  2. This field does not exist in the fieldMap of ve.init.mw.ArticleTarget.prototype.getSaveOptions, causing its key to not be manipulated.
    • Here, it should be changed to watchlistexpiry, a parameter recognized by the edit API and not intercepted by the VE API, that correctly sets the watch expiry. By forging requests, it is confirmed that watchlistexpiry works.
  3. Neither the VE API nor the edit API recognizes the key, and hence, the expiry is not set. However, watchlist=watch also exists in the request, resulting in an indefinite watch.
    • It should be noted that the returned values from the edit API, watched and watchlistexpiry, are correctly handled by the VE API handler. Therefore, if the duration was somehow successfully set (e.g. by applying my patch), visuals work as expected.

Event Timeline

Change #1165010 had a related patch set uploaded (by 1F616EMO; author: 1F616EMO):

[mediawiki/extensions/VisualEditor@master] ext.visualEditor.articleTarget: Corrects the POST key of wpWatchlistExpiry

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

the issue described here seems similar to T397709: Watchlist expiry not set when saving page edit

Yes, they are the same issue.