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

fix: prevent Iterator to loop forever #53

Merged
merged 1 commit into from
Oct 22, 2021
Merged

fix: prevent Iterator to loop forever #53

merged 1 commit into from
Oct 22, 2021

Conversation

jacobgarder
Copy link
Contributor

It seems the Zscaler-API is behaving a bit odd for sublocations. It does not care about the page query-param.

A call to : /locations/30920164/sublocations?page=10 will still produce the same set of sublocations as
/locations/30920164/sublocations?page=1

This causes the Iterator to go into an infinite loop when trying to list all sub locations of a parent location as it does not stop until it gets an empty list as response.

Either we do not use the Iterator for sublocations or, as I suggest we simply add max_pages=1 to the call as it will only be one page anyway.

Copy link
Owner

@mitchos mitchos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mitchos
Copy link
Owner

mitchos commented Oct 22, 2021

Let's merge this change for now, I think either solution really achieves what we want. Keeping the iterator means a small change later if/when they fix it.

@mitchos mitchos self-assigned this Oct 22, 2021
@mitchos mitchos merged commit 06f058f into mitchos:develop Oct 22, 2021
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.

2 participants