Repository navigation
Fix duplicate and skipped results in paginated lists - #1794
Open
pcbeingused33 wants to merge 1 commit into
Open
pcbeingused33 wants to merge 1 commit into
pcbeingused33 wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 Changes
auth0 apps list -n 150can repeat 50 applications and omit 50 because the shared paginator changesper_pagefrom 100 to 50 on page 1. The API calculates the offset aspage * 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,usersand their sub-lists), so they get the same fix for--numbervalues above 100 that are not multiples of 100.📚 References
auth0 logs list.🔬 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 onmainand passed with the fix.make lintandmake test-unitalso passed.📝 Checklist
AI assistance was used to prepare the fix and regression test.