Page MenuHomePhabricator

Inconsistent state after AJAX board re-order
Closed, ResolvedPublic

Description

There is inconsistent state after an AJAX board re-order (clicking the sort menu in upper right and changing it).

After re-sort:

  1. On a board with more than 10, but fewer than 50 topics, it will correctly show the first 10. However, rather than infinite scroll working, it will instead display, "There are no older topics."
  1. On a board with more than 50 topics (e.g. https://www.mediawiki.org/wiki/Talk:Sandbox), when you infinite scroll at the bottom, it will jump into the past, then load forwards in time from there (upwards gap-handling).

I think this is due to inconsistent state from https://phabricator.wikimedia.org/diffusion/EFLW/browse/master/modules/mw.flow.Initializer.js;0215bea94b52eb678900d47da7b9932b7d732933$291 . The idea is to load 50 for the TOC, but only display 10.

However, the pagination data in the request is based on the amount you actually requested and received. So if you request 50, and there are 15, it will give you 15 with pagination data indicating there are no more. It only displays 10, but the pagination data still indicates there are no more.

Similarly, when there are more than 50, there is pagination data but it starts you from the 51st, not the 11th as expected.

The simple solution is to just render all the topics we just fetched.

Event Timeline

Mattflaschen-WMF raised the priority of this task from to High.
Mattflaschen-WMF updated the task description. (Show Details)
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 251801 had a related patch set uploaded (by Mattflaschen):
On re-sort, just render all the topics we fetched

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

Change 251801 merged by jenkins-bot:
On re-sort, just render all the topics we fetched

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

There is an issue in betalabs - filed as T118872: Missing data notifications on dashboards- with scrolling a board while the sorting is in progress.

The only board where I saw it - http://en.wikipedia.beta.wmflabs.org/wiki/Talk:ET1. Click to change the order option from Newest to Recently active topics. Start scrolling down immediately and then up while sorting is in progress - the spinner is spinning and the board text is dimmed. And it never finishes to reload.

The Console displays
[FLOW] Failed to getInstanceByElement: no $container.length

[FLOW] Error in component handler: makeContentInteractive TypeError: component.emitWithReturn is not a function.

There is an issue in betalabs - filed as T118872: Missing data notifications on dashboards- with scrolling a board while the sorting is in progress.

That was a typo, should be T118782: [betalabs] js errors when scrolling a page during re-sorting