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

listUsers : Pagination Broken when used together with sortBy parameter #1584

Open
KneupnerTrackunit opened this issue Jan 8, 2025 · 1 comment
Assignees

Comments

@KneupnerTrackunit
Copy link

Describe the bug?

We use the UserAPI. When we call
userApiClient.listUsers(CONTENT_TYPE, null, after, limit, null, search, sortBy, sortOrder)
with the following parameters:
search: profile.accountId eq "xxx" and [type.id](https://type.id/) eq "yyy"
after: 00u1aadtre06z5eVR358
limit: 30
sortBy: profile.employeeNumber
sortOrder: desc

we get this:
com.okta.sdk.resource.client.ApiException: {"errorCode":"E0000031","errorSummary":"Invalid search criteria.","errorLink":"E0000031","errorId":"oae-1ADf2njTOSCk7A-_H2A8w","errorCauses":[{"errorSummary":"Invalid cursor."}]}

Now, the "after" string is taken from the first call to the same function. So the first time it works, the second fails.
Investigation shows that it only happens when sortBy is set.

What is expected to happen?

The second call, with the after call from the first call should return the next batch of users, just as it does when sortBy is not set.

What is the actual behavior?

The API returns com.okta.sdk.resource.client.ApiException: {"errorCode":"E0000031","errorSummary":"Invalid search criteria.","errorLink":"E0000031","errorId":"oae-1ADf2njTOSCk7A-_H2A8w","errorCauses":[{"errorSummary":"Invalid cursor."}]}

Reproduction Steps?

you need to have a longer list to search for, use the pagination and do a second call, transferring the after string to the next call.

Additional Information?

(I believe,) We do have the profile enriched with self-defined data. However, all is working well if we don't use the sortBy parameter.

Java Version

openjdk version "21.0.4" 2024-07-16 LTS
OpenJDK Runtime Environment Temurin-21.0.4+7 (build 21.0.4+7-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.4+7 (build 21.0.4+7-LTS, mixed mode)

SDK Version

com.okta.sdk:okta-sdk.api:20.0.0
com.okta.sdk:okta-sdk.impl:20.0.0

OS version

several OS, including Linux and
Darwin J90J09F4CY 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec 6 19:02:12 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6031 arm64

@Vithanco
Copy link

Vithanco commented Jan 9, 2025

Problem was confirmed by an Okta employee, on Okta developer Questions portal: https://support.okta.com/help/s/question/0D74z00000EKmbXCAT

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

No branches or pull requests

3 participants