Value of 0 for "Days to show in watchlist" or "Maximum number of changes to show in watchlist" setting breaks watchlists; should instead be interpreted as maximum or no limit
Open, Needs TriagePublic

Description

Per T176033 and T198961 setting the value of "Days to show in watchlist" in Special:Preferences#mw-prefsection-watchlist breaks watchlists in that no changes are displayed (in my testing even changes less than 1 minute old were not shown). This value is therefore nonsensical. At T176033#4115252, @Krinkle noted that there are over 1000 users with this setting on Commons alone, suggesting that it previously gave a useful result (this change presumably occurring circa early September 2017).

It is most probable that users a setting a value of zero intended this to mean that that there should be no limit to the number of days displayed, and this would seem to me to be the most logical behaviour going forwards. If no limit is not technically possible, then interpreting 0 as equalling the value of the maximum number of days currently defined for that wiki (i.e. not a hardcoded value) would achieve equally useful results in practical terms.

Similarly the same logic should apply to the "Maximum number of changes to show in watchlist" setting, with 0 meaning "no limit" or "maximum", with the watchlist displaying all changes until whichever of the time or number limits is reached first.

If 0 is equal to "no limit" then MediaWiki should not allow both preferences to be set to this value. If 0 is equal to maximum there will be no issues (that I am aware of) with both being 0.

See also: T176857: Watchlist links with "&days=0" give an incorrect display

Restricted Application added a project: Growth-Team. · View Herald TranscriptSun, Jul 8, 10:54 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I suppose another approach would be to disallow 0 as a value and change all existing instances of this value to be equal to the current maximum. This would be less preferable to the above though.

Quiddity updated the task description. (Show Details)Sun, Jul 8, 8:07 PM
JTannerWMF moved this task from Inbox to To Triage on the Growth-Team board.Tue, Jul 10, 5:29 PM
MMiller_WMF moved this task from To Triage to Revisit on the Growth-Team board.Tue, Jul 10, 5:45 PM

To summarize the findings (and for further checking after the fix):

(1) The fix in T176857: Watchlist links with "&days=0" give an incorrect display was to restore the previous functionality, so

watchlist links with a "days=0" URL parameter to interpret that as meaning 0 days rather than "all available days" as it previously did.

It seems that such interpretation (0 days as all available days) was useful to some user.

(2) Presently (wmf.12), the Preferences-Watchlist options "Days to show in watchlist" and "Maximum number of changes to show in watchlist" can be set to zero and users' experience is documented in the table below.
Note: the testing is done on testwiki where the "Period of time to display" system option default is set to "1 hour" in the seletor.

"Days to show in watchlist""Maximum number of changes to show in watchlist"the displayed messageafter clicking on 'Show'
00"Below are the last 0 changes in the last 0 hours ""Below are the last 0 changes in the last hour"
0not zero"Below are the last 0 changes in the last 0 hours" Actual results will be shown - the user settings will be overridden
not zero0"Below are the last 0 changes in the last [number set] hours""Below are the last 0 changes in the last [number set] hours"

(3) The '0' value is explicitly specified as a valid value:

(4) The related tasks are the following:
T176033: Watchlist param days=30 doesn't override user preference 'watchlistdays' = 0 - added as a subtask
T176857: Watchlist links with "&days=0" give an incorrect display - it may be re-opened
T198961: Watchlist on meta wiki not displaying changes until "show" button is clicked - marked as duplicate to this task

IMO clicking "show" should always display the results of the settings in the form, even if they are unchanged and even if the defaults differ from user preference settings (what the defaults should be is an unrelated issue).

I cannot think of any situation in which actually displaying the last 0 changes and/or changes in the last 0 hours (i.e. showing a watchlist which never has any changes on it) would be a useful feature.

Obviously the message should match what is actually displayed but this is just a trivial aspect of this, the key part is correcting the part of rMWb747307a2002 that broke the previous, useful, behaviour of days=0