Skip to content

Fix duplicate and skipped results in paginated lists - #1794

Open
pcbeingused33 wants to merge 1 commit into
auth0:mainfrom
pcbeingused33:fix/list-pagination
Open

pcbeingused33 wants to merge 1 commit into
auth0:mainfrom
pcbeingused33:fix/list-pagination

Conversation

@pcbeingused33

Copy link
Copy Markdown

🔧 Changes

auth0 apps list -n 150 can repeat 50 applications and omit 50 because the shared paginator changes per_page from 100 to 50 on page 1. The API calculates the offset as page * per_page, so that request starts at offset 50.

Keep the page size fixed across requests and trim the last batch to the requested number of results. The same helper backs the other paginated list commands (apis, orgs, roles, users and their sub-lists), so they get the same fix for --number values above 100 that are not multiples of 100.

📚 References

🔬 Testing

Run go test ./internal/cli -run '^TestAppsListCmdPagination$' -count=1. The test simulates a tenant with 250 applications and checks that the command returns exactly IDs 0 through 149 in order. The regression failed on main and passed with the fix. make lint and make test-unit also passed.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A) — N/A: the fix restores the documented behavior of the number flag.

AI assistance was used to prepare the fix and regression test.

@pcbeingused33
pcbeingused33 requested a review from a team as a code owner December 1, 2026 08:10

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant