Peter-Schorn/SpotifyAPI

"extendPagesConcurrently" causes crash

wiencheck opened this issue · 7 comments

This crash is affecting a lot of my users however I've not been able to reproduce it on my side.
The crash cause is Swift runtime failure: Stride size must not be zero

Screenshot 2024-05-20 at 09 49 43

I have identified the root cause of this bug and will deploy a fix soon. It's caused by Spotify returning a value of 0 in the JSON payload for the PagingObject.limit property, which specifies the maximum number of items in the current page (and the step for the page offset interval). You cannot iterate over an interval with a step of 0.

Please Try 4297eb6. Should now be fixed in 3.0.1. Please close if this fixes your issue.

It seems that those changes broke the extendPages functionality because now it only downloads first page and returns. I rolled back to 3.0.0 and then was able to download all pages from PagingObject so 3.0.1 definitely broke some logic

Oh noo. Will take a look.

I think this is the issue:

if maxOffset >= minOffset {
return []
}

This was supposed to be:

if minOffset >= maxOffset {
    return []
}

This will prevent crashes.

Please try 39fd1be.

After testing it seems that the issue is now resolved, thank you!