question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Grid Table: Same Request Sent Over and Over Again

See original GitHub issue

URL (minimal example if possible):

embed.plnkr.co/ZnEpcAy5iKaukNXd

Given

  • A grid table (sap.ui.table.Table) having rows aggregation bound with Northwind’s /Customers. The service leverages server-side paging ("__next").
  • Low number of Table’s threshold.

Steps to reproduce the problem:

  1. Open the above example page and wait until the preview panel is loaded.
  2. Once the initial entries are loaded and the focus is set on the first row, press <kbd>Ctrl + End</kbd> to scroll to the end of the table. Do not scroll up afterwards.
  3. Wait until any entries are loaded in the scrolled area… forever.

What is the expected result?

The table gets filled in the visible rows.

What happens instead?

  • Requests are sent constantly and which never stops. I waited for around an hour until the browser ultimately crashed (Probably due to highly accumulated memory footprint).
  • If table’s enableBusyIndicator is set to true, the user cannot even scroll up anymore due to the busy indicator blocking all user interactions. Only when the user scrolls up until the previously loaded entries are visible, the table starts to get filled properly.

Any other information? (attach screenshot if possible)

I guess this behavior has something to do with the fact that the grid table involves both server- and client-side paging. Whether it’s an anti-pattern or not shouldn’t be a matter of this issue though.

ui5 sap ui table table same request sent over and over again Network trace showing the same request being sent over and over again

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Thoddcommented, Jul 26, 2019

Hi guys,

So the endless loop should be fixed, as we have reworked the $skip/$top value calculation.

The Northwind responds with a set of max. 20 entries and a __next link, even though the request sent by the ODataListBinding contains a $top value of 60. We know that this can happen, and the approach of the ODataListBinding is to ignore the __next link, and keep on sending consecutive requests with adapted $top and $skip values. This is ok, since following __next links also ends up in multiple requests to satisfy the original data request by the table.

Though if you aim for a productive scenario the mix of our $skip/$top based paging and the Northwind’s __next paging mechanism is suboptimal, as it will end up in multiple requests, which cannot be optimized as easily.

I would not advice to use such a mix in a real-life scenario.

Ideally you should just use a regular $skip/$top based paging. The Northwind also offers other collections, which will fully respect $skip/$top, e.g.: https://services.odata.org/V2/Northwind/Northwind.svc/Product_Sales_for_1997?$skip=10&$top=60&$format=json

At the moment we have no intention to implement a server-side paging based on __next links, but of course contributions are welcome and appreciated if anyone out there wants to tackle this.

BR, Thorsten

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wait for backend service response before making changes to ...
Since I have access to the old value I can easily do something like event.node.setDataValue(event.column, event.oldValue) to revert the user's ...
Read more >
Refreshing the Datasource of a Grid not working - Telerik
1. I make ajax call again. 2. I associated new data with grid's data source. 3. I called grid.dataSource.read();
Read more >
Create a make table query - Microsoft Support
A make table query retrieves data from one or more tables, and then loads the result set into a new table. That new...
Read more >
Grid Events - JavaScript Data Grid
This is a list of the events that the grid raises. You register callbacks for these events through the GridOptions interface. The name...
Read more >
How to Integrate the Material UI Data Grid in React Using Data ...
Material UI's Data Grid is a powerful and flexible data table. ... The request can be of any APIs that send and receive...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found