Skip to content

Need to recalculate remaining if there's an error#365

Merged
michael-richey merged 6 commits intomainfrom
michael.richey/remainin-calc-fix
Aug 15, 2025
Merged

Need to recalculate remaining if there's an error#365
michael-richey merged 6 commits intomainfrom
michael.richey/remainin-calc-fix

Conversation

@michael-richey
Copy link
Copy Markdown
Collaborator

@michael-richey michael-richey commented Aug 14, 2025

What does this PR do?

Need to keep going after an error so remaining can't be 0. We also don't have a resp in the except block so we can't calculate the real number of remaining elements, just set it to 1 to keep going. If were at pagesize 1 we need to set it back.

Also "handle" a 404 by just breaking out to the loop, stopping the process. If something is missing that we expect to be there then that's an issue.

During the testing the users public API changed. The GET returns a new field allowed_login_methods but the POST doesn't allow it, so it has to be excluded.

Description of the Change

The remaining variable was only being updated during a success, not in the except section of the code. It needs to be recalculated in every iteration of the loop. Moved the debug before setting it to 0 so it's useful again and added idx to the debug.

@michael-richey michael-richey marked this pull request as ready for review August 14, 2025 20:39
@michael-richey michael-richey requested a review from a team as a code owner August 14, 2025 20:39
@michael-richey michael-richey merged commit 13b41e8 into main Aug 15, 2025
11 checks passed
@michael-richey michael-richey deleted the michael.richey/remainin-calc-fix branch August 15, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants