lvermeulen / Bitbucket.Cloud.Net

C# client for Atlassian Bitbucket Cloud
MIT License
13 stars 19 forks source link

GetPagedResults: fix bug causing 2nd page to be fetched in a loop #5

Closed aviish closed 4 years ago

aviish commented 4 years ago

Currently GetPagedResults assigns selectorResults.Page to Math.Max(0, 1) which always evaluates to 1, causing the next page to always be page 2. This results in a loop where the second page is repeatedly fetched until the server kicks you out for violating the API rate limit.

The fix assigns the page number to be 1 only when it is less than 1, i.e. missing.

Xcone commented 4 years ago

Any news on this? I see this has been open for a bit yet. I've started using this package the other day. It looks promising, but without working pagination there's little point for me to continue using it.

lvermeulen commented 4 years ago

Thanks, @aviish !