-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@odata.nextLink doesn't work when query contains $orderby=parentEntity/childEntity #1147
Comments
I understand that this might be some simplification of your issue but expanding, selecting and ordering inside of a single property would probably behave better with this query |
also after checking the implementation of |
Thanks for the answer.
Although it seemed to me that such functionality should be out of the box. |
I think you would need to implement a |
@aboryczko thanks. |
I was able to catch the same issue with a complex property as well. https://github.com/senioroman4uk/odata-skip-token-exception Any suggestions to mitigate this would be appreciated.
|
I don't know @AndriiLesiuk but it feels like a nasty bug to me for sure... especially with it generating "garbage" instead of just throwing an exception or something to signal it wouldn't be supported (if it really was supposed to not be supported in the first place, which I don't think is the case here). This type of issue makes the library look very unprofessional IMHO. Would be nice if it could be prioritized @habbes . |
@julealgon @senioroman4uk @AndriiLesiuk thanks. We're currently working on fixing this issue cc @xuzhg |
@AndriiLesiuk @senioroman4uk With the latest 8.2.4, it should work using $orderby=complex/property without enable skiptoken. as @habbes mentioned, we are fixing the issue now. But, it's related to the following discussion: What skiptoken pattern by default should take for advanced $orderby? For example, here's a complex $orderby: What skiptoken should look like:
or or
or
@julealgon @senioroman4uk @AndriiLesiuk any thoughts? |
@xuzhg |
@AndriiLesiuk -- the issue with including only the id in the $skiptoken is that we need to know the last read values of all orderby properties in order to generate the query to read the next page. We already have those values when generating the skiptoken, so encoding them in the skiptoken saves us from having to calculate them when generating the query for the next page. If we don't serialize them as part of the skiptoken, then when we parse the skiptoken we either need to make a separate request to get the values to use to generate the query for the next page, or we need to create a potentially very complex query with multiple subselects in order to calculate those values as part of executing the next page query. Our primary concern with either case is performance -- we're adding a lot of server load to recalculate something that we already had and could have just encoded in the skiptoken (which is defined as being opaque). A second concern would be if the last record read happened to be deleted then we wouldn't be able to process the skip token, where-as if we included the values when we generated the skiptoken then it would be resilient to the record being changed or deleted. |
OData 8.2.3
My Odata query:
https://localhost:44325/odata/Mas?$expand=product&$select=product&$orderby=product/name
It returns me such responce:
with current @odata.nextLink:
"@odata.nextLink": "https://localhost:44325/odata/Mas?$expand=product&$select=product&$orderby=product%2Fname&$skiptoken=name-null,source_id-%2711514%27"
When I follow this link I get the following error:
For some reason, the functionality is trying to find the "name" field in the parentEntity.
If it's not a bug, then tell me how to make my query work.
Thank you for your advice.
Project to reproduce
The text was updated successfully, but these errors were encountered: