Skip to content
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

Empty result when pagesize (count) is smaller than startIndex #131

Closed
HoaiDang-work opened this issue Mar 19, 2021 · 5 comments
Closed

Empty result when pagesize (count) is smaller than startIndex #131

HoaiDang-work opened this issue Mar 19, 2021 · 5 comments

Comments

@HoaiDang-work
Copy link

My List User request: /scim/v2/Users?startIndex=11&count=10&filter=externalId pr
I have more than 100 users, want to get 10 users started from index 11, I got empty response.

@Captain-P-Goldfish
Copy link
Owner

How many results are returned if you remove "startIndex" and "count"?
This is actually intentional behaiour. Filtering is executed before stripping left and right results. So if your query does return less than 10 users you obiously get an empty result since the startIndex is out of range.
I just ran some tests with this and I could not find any actual issues. You are free to prove me wrong but I would need more information to find the cause since I am not able to reproduce this.

@HoaiDang-work
Copy link
Author

FYI...I don't use auto filterting. If i remove startIndex and count and call this request scim/v2/Users?filter=externalId pr, the result is as I expected:
"totalResults": 192,
"itemsPerPage": 50,
"startIndex": 1,

The "Resources" list has 50 items.

@Captain-P-Goldfish
Copy link
Owner

I see this is indeed a big problem. I will try to fix it until evening.

@Captain-P-Goldfish
Copy link
Owner

Captain-P-Goldfish commented Mar 21, 2021

I worked out a solution. If you got a better idea please bring it out:

my idea:
I added a new field to class de.captaingoldfish.scim.sdk.server.response.PartialListResponse with name startIndexUsed. If this field is set to true the startIndex will no longer be evaluated by the scim api. This would also be backwards compatible. But you would have to set this value to true if you do this directly on database-level.

@HoaiDang-work
Copy link
Author

How about you just do the checking when auto-filtering is true? If the app implements the pagination on its own, it is responsible to retrieve the correct result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants