SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.95k stars 1.23k forks source link

Use skiptoken instead of skip #3389

Closed Mabenan closed 2 years ago

Mabenan commented 2 years ago

OpenUI5 version:

Browser/version (+device/version): 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' Any other tested browsers/devices(OK/FAIL):

URL (minimal example if possible):

User/password (if required and possible - do not post any confidential information here):

Steps to reproduce the problem: 1.Use MS Graph with a Collection with more than 100 Items 2. 3.

What is the expected result? That the Odata Request is made without the $skip query and the server side paging over $skiptoken is used.

https://graph.microsoft.com/v1.0/groups?$top=20 &$skiptoken=RFNwdAIAAQAAACpHcm91cF84MGIxMmRjNS0zMWQ1LTQwOTQtOThiYi1jNWViM2FiN2ZiNzcqR3JvdXBfODBiMTJkYzUtMzFkNS00MDk0LTk4YmItYzVlYjNhYjdmYjc3AAAAAAAAAAAAAAA

What happens instead? All OData Requests are executed with $skip and $top https://graph.microsoft.com/v1.0/groups?$skip=20$top=20 Results in error

Any other information? (attach screenshot if possible)

IlianaB commented 2 years ago

Hello @Mabenan ,

I've created an internal incident 2170325575. The status of the issue will be updated here in GitHub.

Regards, Iliana

pksinsik commented 2 years ago

Hello @Mabenan,

I tested a little bit with the MS Graph service offered in https://developer.microsoft.com/en-us/graph/graph-explorer incl. the query you have referenced and $skip seems unsupported in general though it is a standard OData system query option. UI5 models e.g. for OData V4 are meant for data binding to controls; table controls use the ListBinding#getContexts implemented by specific models in order to efficiently read the range of entries which is to be shown on the UI. That's why the capability to read a certain range is required which is "translated" to $skip/$top in OData. With this, it is e.g. possible to jump at the end of a collection on the UI without reading it completely. From this perspective, services not supporting $skip are not well suited to be consumed in a UI. You may however use a "maximum prefetch size" for read requests with the OData V4 Model; setting this value to Infinity should do the trick to get rid of the $skip/$top. Concretely, it should be possible to achieve this e.g. for a table.Table control by setting its threshold property to Infinity.

Regards, Patric