Page MenuHomePhabricator

Watchlist "2 hours" option redisplays as "1 hour"
Closed, ResolvedPublic

Description

The watchlist "time period" settings have turned into a drop-down list. Most of the options are preserved when the watchlist displays - select "6 hours" and "Go", and the watchlist is redisplayed with "6 hours" selected. But "2 hours" redisplays with "1 hour" selected.

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

John_of_Reading updated the task description. (Show Details)
John_of_Reading raised the priority of this task from to Needs Triage.
John_of_Reading added a subscriber: John_of_Reading.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptNov 20 2015, 10:30 AM
hgzh added a subscriber: hgzh.Nov 20 2015, 7:52 PM

This is because 2/24 = 0,83333... which gets cut to 15 decimals in the html form. But we check the &days= parameter in php to be exactly 2/24 which returns false and so the option doesn't get selected.

Rounding would help here, but isn't it easier to pass the maxage for the watchlist in hours (only integers as url parameters required)?

matmarex claimed this task.Nov 22 2015, 3:56 PM
matmarex added a subscriber: matmarex.

Rounding would help here, but isn't it easier to pass the maxage for the watchlist in hours (only integers as url parameters required)?

If only Lee Daniel Crocker, who wrote the first version of this code back in 2003, realized how big Wikipedia is going to grow and that people will want to view changes from time periods smaller than one full day… :)

I'll fix the comparison to use correct rounding and try to get the fix deployed on Monday.

Change 254373 had a related patch set uploaded (by Florianschmidtwelzow):
Special:Watchlist: Add the user preference to the show last select options

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

@matmarex This bug would be fixed with https://gerrit.wikimedia.org/r/#/c/254373/, too, so I'm free and take the task, ok? :]

matmarex reassigned this task from matmarex to Florian.Nov 22 2015, 9:15 PM

Sure, thanks.

matmarex triaged this task as High priority.Nov 22 2015, 9:19 PM

Change 254373 merged by jenkins-bot:
Special:Watchlist: Add user preference to "Show last" options, fix float comparison

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

Change 254880 had a related patch set uploaded (by Bartosz Dziewoński):
Special:Watchlist: Add user preference to "Show last" options, fix float comparison

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

Change 254880 merged by jenkins-bot:
Special:Watchlist: Add user preference to "Show last" options, fix float comparison

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

matmarex closed this task as Resolved.Nov 23 2015, 4:34 PM

Fixed and deployed.