Skip to Content
1
Dec 21, 2022 at 04:39 PM

CAP list page data is random on scroll-loading the next batch

413 Views

I'm having an issue with the scrolling autoload on a list page and I'm not sure how to troubleshoot this.

There are 12k entries in the table and the CAP application list page displays 30 entries at a time. I noticed when scrolling down and causing the page to load the next set of 30 that that next set includes a random subset of items that were already displayed at the top of the list.

This is not consistent, sometimes all new entries or a mix of a few or many of the previously loaded entries.

I did some testing with Postman and was able to reproduce the issue with the same OData request that the CAP app sends to the backend, getting different results each time I use $top=30 and $skip=30. I found that if I shorten the OData request in some way, then I finally get consistent results each time I send the request. I can shorten or remove the $select, $filter or $expand and then every request gets the same results.

The CAP application sends the request in a $batch request so the URI length shouldn't be an issue but as far as I can tell the length is the issue.

Any ideas on how to troubleshoot this further? Is there a bug in the backend process that it cannot handle long requests?

Here is an example of the request that I ran in a hybrid environment. It is 545 characters long. Again, this request gets a somewhat random set of entries but if I remove $select then I get a consistent set each time.

http://localhost:4004/serviceDR/Entity?%24count=true
&%24select=HasActiveEntity,ID,IsActiveEntity,partners_ID,displaySomeDuration,externalCode,fullName,messageIndexID,objectUrl,someDuration,dataPartExternal,rowObjectID,status_code
&%24orderby=someDuration
&%24filter=(IsActiveEntity%20eq%20false%20or%20SiblingEntity%2FIsActiveEntity%20eq%20null)
&%24expand=assignee(%24select%3DID,displayFullName),nanPartner(%24select%3DdisplayMessage,externalUrl,partnerInfoID,objectID,nanExternalID),status(%24select%3Dcode,criticality,name)
&%24top=30&%24skip=30

The key fields of Entity are ID and rowObjectID.