Page MenuHomePhabricator

Update frontend for urlversion=2
Closed, ResolvedPublic

Description

Change the frontend to respect the user's defaults even if there are parameters, unless urlversion=2 is passed.

If urlversion=2 is passed, defaults are ignored entirely.

  • Instead, the de-minimis default will be "don't hide" (false or ALL, depending on type). (Others like namespace and tag already have a default of "don't hide").

If urlversion is not 2:

  • No parameters: Default saved query
  • Parameters: Each parameter's individual default is used unless that parameter is overridden in the URL.

Always generate urlversion=2 URLs.

See also T166906: ChangesListSpecialPage backend: Bypass defaults if urlversion=2

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 2 2017, 8:45 PM

Change 357116 had a related patch set uploaded (by Mattflaschen; owner: Mooeypoo):
[mediawiki/core@master] RCFilters: Frontend URL follow backend rules and add 'urlversion=2'

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

Change 357124 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[mediawiki/core@master] RCFilters: Add UriProcessor and unit tests for URL manipulations

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

Added two patches

  • One to activate urlversion=2 (on initialization respect the rules whether it exists or not, and then append it, always, during operation, so all URLs created by RCFilters have it)
  • Another that creates a UriProcessor to better handle URL manipulations and also allow adding unit tests; the unit tests also test the operation of urlversion=2 so they're related here

Please note (also written as comments in the code and in the unit tests) - the assumption that RCFilters front-end system makes is that URLs without urlversion=2 are ONLY happening on initialization; when urlversion=2 doesn't exist (or is equal to anything other than '2') the system overrides the state with whatever parameters are truthy-defaults. This only works when the model is empty state (initializing.) This is a valid assumption because RCfilters always appends "urlversion=2". In the unit tests, it may look a little confusing because if you send an active model (already stateful) a URL that does not have 'urlversion=2' the URL does NOT represent the model state (it overrides it with defaults) -- however, that should and will never happen. After we initialize the state, the URL always represents the model state anyways, and if the user changes the URL manually, the system reloads and refills the model.

Added the above to code comments and unit tests comments, and added a unit test that showcases this (demonstrating the 'bad' behavior)

Change 357124 abandoned by Catrope:
RCFilters: Add UriProcessor and unit tests for URL manipulations

Reason:
Squashed into https://gerrit.wikimedia.org/r/#/c/357116

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

Change 357116 merged by jenkins-bot:
[mediawiki/core@master] RCFilters: Make frontend URL follow backend rules and add 'urlversion=2'

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

Etonkovidova closed this task as Resolved.Jul 14 2017, 6:08 PM
Etonkovidova triaged this task as Medium priority.