Commit e248fb0
authored
Don't reuse response struct for multiple requests
A fix was added in ktrysmt#186 for the infinite loop while paging. The problem is that it didn't fix the underlying issue, and the fix actually breaks paging in certain circumstances. For example, if I have 13 repos, and a page size of 10, we'll do 13/10 = 1, which equals the page number of 1, and break without retrieving the second page).
The actual problem was that the `responsePaginated` variable was being reused in the loop, and the json decoder doesn't overwrite fields that aren't present in the response, so it was the `Next` field would end up with the value from the previous page, causing the same page to be requested forever.1 parent ddf9b55 commit e248fb0
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
| 327 | + | |
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| 339 | + | |
| 340 | + | |
339 | 341 | | |
340 | 342 | | |
341 | 343 | | |
| |||
0 commit comments