Page MenuHomePhabricator

Watchlist Expiry: action=watch doesn't work correctly with $wgLocaltimezone > UTC
Closed, ResolvedPublic5 Estimated Story Points

Description

As a Watchlist Expiry user, I want the action=watch bug fixed, so that I can temporarily watch items on the page according to my local time.

Acceptance Criteria:

  • Fix the current bug associated with action=watch, so that the user can temporarily watch items according to their local time

To reproduce:

  1. Set $wgLocaltimezone = 'Pacific/Auckland';
  2. Use e.g. Special:ApiSandbox#action=watch&expiry=10%20hour&titles=Test to watch a page with expiry of e.g. 10 hour, and check that the returned expiry is correct and in UTC (no probs here).
  3. Go to Test?action=watch and see that the selected item in the dropdown is 0 days, and that its value is the same time as above (still all correct so far).
  4. Click 'Watch' and note that it doesn't say it was added temporarily.
  5. Go to Test?action=watch (but don't reload, as that'll re-send the watch request), and see that the page isn't on your watchlist any more.

Repeat with $wgLocaltimezone = 'UTC'; and it all works correctly, as it does with any TZ value less than UTC.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
ifried renamed this task from action=watch doesn't work correctly with $wgLocaltimezone > UTC to Watchlist Expiry: action=watch doesn't work correctly with $wgLocaltimezone > UTC.Aug 13 2020, 3:00 PM
ARamirez_WMF set the point value for this task to 5.Aug 13 2020, 5:40 PM
ifried subscribed.

I have removed this ticket from the Kanban board, since we want to first see if T260868 fixes the problem.

ifried added a subscriber: HMonroy.

Change 623052 had a related patch set uploaded (by HMonroy; owner: HMonroy):
[mediawiki/core@master] Normalize WatchedItem expiry field

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

Change 624600 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/core@master] Check existing watchitem when saving action=watch

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

Change 624600 merged by jenkins-bot:
[mediawiki/core@master] Check existing watchitem when saving action=watch

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

Change 626252 had a related patch set uploaded (by HMonroy; owner: Samwilson):
[mediawiki/core@REL1_35] Check existing watchitem when saving action=watch

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

Change 626252 merged by jenkins-bot:
[mediawiki/core@REL1_35] Check existing watchitem when saving action=watch

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

Cannot reproduce with the steps in the description locally and on https://ko.wikipedia.beta.wmflabs.org (MediaWiki 1.36.0-alpha (2a5dbf7) 20:52, 18 September 2020) (which is UTC+9, so I set the expiry time < 9 hours).

I tested with $wgLocaltimezone set to a few different timezones greater than and less than UTC (incl. 'Pacific/Auckland').

Going to action=watch, the value of the option in the dropdown (when you inspect the HTML) is always in UTC of the form "2020-09-16T01:34:45Z".

On submitting action=watch, the expiry does not change and there are no writes to the database.

@ifried I am not sure where you would test this when it has gone on production. But, on beta you can test https://ko.wikipedia.beta.wmflabs.org, for example.

I have tested this on https://ko.wikipedia.beta.wmflabs.org, and it looks good. The changes have been deployed to production as well. We do not yet have watchlist expiry enabled on a wiki within a timezone that would fit the criteria of the ticket (other than the test version). However, since the behavior was validated on beta, and since the change has been released, I'll mark this work as Done.

Change 623052 merged by jenkins-bot:
[mediawiki/core@master] Normalize WatchedItem expiry field

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

Change 632675 had a related patch set uploaded (by MusikAnimal; owner: HMonroy):
[mediawiki/core@REL1_35] Normalize WatchedItem expiry field

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

Change 632675 merged by jenkins-bot:
[mediawiki/core@REL1_35] Normalize WatchedItem expiry field

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