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 handling of zaaktypen responses #77

Merged
merged 3 commits into from
Dec 11, 2023
Merged

Conversation

Viicos
Copy link
Contributor

@Viicos Viicos commented Dec 11, 2023

Related:

Second commit fixes open-formulieren/open-forms#3664 in two ways:

  • The wrong keyword argument was used when calling client.list, resulting in the page query param not being updated, and thus making the same request until we hit OOM.
  • the page query param of the next URL was wrongly incremented. This issue was hidden by the first one.

@Viicos Viicos changed the title Fix handling of non compliant error responses Fix handling of zaaktypen responses Dec 11, 2023
@@ -35,11 +35,11 @@ def get_zaaktypen() -> Dict[Service, List[Dict[str, Any]]]:
while response["next"]:
next_url = urlparse(response["next"])
query = parse_qs(next_url.query)
new_page = int(query["page"][0]) + 1
new_page = int(query["page"][0])
Copy link
Member

Choose a reason for hiding this comment

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

Had to check if our new pagination helper is also affected, but that one doesn't bother with parsing stuff at all so nice one 🎉

I had a suspicion it had something to do with pagination, I just expected it to end up in an infinite loop 🤔

@sergei-maertens sergei-maertens merged commit 7de0c1e into main Dec 11, 2023
10 checks passed
@sergei-maertens sergei-maertens deleted the fix-error-handling branch December 11, 2023 16:31
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.

ZGW API Sets button in admin causes infinite loop
2 participants