Page MenuHomePhabricator

History pagination does not work properly
Closed, ResolvedPublic

Description

While working on T111494: BadMethodCallException on history of a Flow page, I noticed that the indexes did not seem to take into account offset-id.

Going to https://www.mediawiki.org/w/index.php?title=Talk:Sandbox&action=history&limit=500 , then clicking older 500 takes you to https://www.mediawiki.org/w/index.php?title=Talk:Sandbox&offset=sjts6vxe5bh5pdla&limit=500&action=history , which shows exactly the same output.

This seems to be because the indices ignore offset-id.

Direct DB accesses (e.g. because you exceeded the limit) show the previous 500 is accessible that way. When accessing 1000, the oldest one shown is 22 April 2015.

https://www.mediawiki.org/w/index.php?title=Talk:Sandbox&action=history&limit=1000

The 'oldest' link (dir=prev) is also broken. E.g. https://www.mediawiki.org/w/index.php?title=Talk:Sandbox&dir=prev&action=history currently shows an oldest entry of 24 June 2015, which is clearly not the oldest (see above where there is at least 22 April 2015, but there are even older ones). I think it is just showing the oldest ones in the TopKIndex.


Apparently, the DB also does not support pagination, unless I'm missing something. So pagination will only work within the index. You apparently can neither span between index and DB, or paginate the DB itself. However, you can still set whatever limit you want, and that will work.

See also T114456: Main topic list pagination can only paginate at most 500 topics (less sometimes, apparently due to moderation).

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Mattflaschen-WMF renamed this task from History pagination does not work properly when data is in index to History pagination does not work properly.Sep 11 2015, 3:07 AM
Mattflaschen-WMF triaged this task as Unbreak Now! priority.
Mattflaschen-WMF updated the task description. (Show Details)

Change 237872 had a related patch set uploaded (by Mattflaschen):
WIP: Fix exception on history page

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

Change 237872 merged by jenkins-bot:
Fix exception on board and topic history pages

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

Change 243337 had a related patch set uploaded (by Mattflaschen):
Fix exception on board and topic history pages

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

Change 243337 merged by jenkins-bot:
Fix exception on board and topic history pages

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

@matthiasmullie @EBernhardson @werdna I'm looking at how/if I can port offset-elastic to the database query. It looks like (using an example of 'rev' order when the offset is the 31th item (30 with 0-index) and you request a limit of 50):

  1. If offset-elastic is false, it will just give you the 30 items.
  2. If offset-elastic is true, it will give you the first 50 items, essentially overshooting the offset and giving you it again (plus 19 more). I guess this is what 'elastic' refers to.

I don't really understand the point of #2 if I'm describing it right (it seems it would give you items you've already seen), but it is being used by Pager.

Is this what it does? Could it be removed?

Change 245621 had a related patch set uploaded (by Mattflaschen):
WIP: Fix history pagination and give user the number of entries they requested

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

The Gerrit change has not seen any updates for six weeks.
Are there any news / progress to share?
Is the current priority correct (does not seem so)? Thanks.

Change 245621 merged by jenkins-bot:
Fix history pagination and give user the number of entries they requested

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

  1. Checked https://www.mediawiki.org/w/index.php?title=Talk:Sandbox&action=history&limit=500 and https://www.mediawiki.org/w/index.php?title=Talk:Sandbox&offset=sjts6vxe5bh5pdla&limit=500&action=history. The pages do have different output now.

The below is mostly to document the present behavior - the behavior is logical, although it's a bit convoluted. To differentiate between combinations of (latest | earliest) View (newer 50 | older 50) is not a trivial task.

  1. Checking offset with 50 topics on a page.

a) On http://en.wikipedia.beta.wmflabs.org/wiki/User_talk:ET59, which is a Flow enabled page, created 50 topics named as 1, 2, 3...50.
b) History displays those topics from 50(most recent) to 1(the first one created) in descending order. Latest-newer are default options on the page.
http://en.wikipedia.beta.wmflabs.org/w/index.php?title=User_talk:ET59&limit=50&action=history

c) Click on the option earliest without changing anything else -the list will be re-sorted from the topic entry "49" to the earliest entry which is "Flow talk page manager (Talk | contribs) created the description". The options earliest|older get selected.

http://en.wikipedia.beta.wmflabs.org/w/index.php?title=User_talk:ET59&dir=prev&action=history

d) Return to the state in a) by clicking on latest

e) Click on older - The options earliest|older get selected.
http://en.wikipedia.beta.wmflabs.org/w/index.php?title=User_talk:ET59&offset=sujrori9eqr8sf14&action=history

The only entry is displayed "Flow talk page manager (Talk | contribs) created the description".

Catrope added a subscriber: Catrope.