Description
I suspect there's a bug in arrayBySplittingArray
, particularly:
I think there are two issues, but this is only a suspicion as there are no test cases for arrayBySplittingArray
. I don't recall, how range works for objective-c, but if it's similar to swift, I'm sure there's an issue. Basically, batches can be missed when the number of objects go over the default batch limit of 50
. I suspect most people are batching with < 50 objects so the issue won't show up there.
- The endpoint of the subarray should grow dynamically while iterating through the
while
loop, it currently isn't doing this properly. Should beindex+length
. - If range works the same way as Swift, then it should be
<
the endpoint of the array or else it can jump out-of-bounds.
If someone wants to take this on, replicating the test cases I wrote for ParseSwift should detect the problem .
The ParseSwift equivalent for arrayBySplittingArray
is here which can be used to fix the bug: https://github.com/parse-community/Parse-Swift/blob/f1de7e4a95d937bcc008bc5ef040ebba3ced7adb/Sources/ParseSwift/API/BatchUtils.swift#L35-L49