Skip to content

ReadUsers function only returns first 1000 users #513

@Lars2-Elimity

Description

@Lars2-Elimity

Frodo Library version

"@rockcarver/frodo-lib": "^3.3.1"

Describe the issue

I am calling the readUsers function to list all users in a Realm. I am working with a big organization with 1000+ users. The issue is that the function only returns the first 1000 users. Upon inspection of the code, I noticed a pagination issue.

Here, in the source code, it can be seen that the readUsers function calls the getUsers function and uses the result from that function, which is of type Promise<UserSkeleton>.

While in the getUsers function, the return type is Promise<PagedResult<UserSkeleton>>.

The PagedResult type clearly shows pagination information, which is ignored by the readUsers function (as it only uses the result property.

Proposed solution

The readUsers function should be altered so that the pagination information is extracted and acted upon. This can be done using the remainingPagedResults property. This property will be -1 when all data is returned and can be used to close the loop.
Pagination in the rest API can be done using the _pagesize and _pagedResultsOffset query parameters.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions