You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 be index+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 .
length is either the batch size of 50 or the number of remaining elements in the array, whichever is smaller. I cannot see any off-by one situations in that algorithm either, could be give me an example in numbers where there would be an out-off-bounds access to array?
I suspect there's a bug in
arrayBySplittingArray
, particularly:Parse-SDK-iOS-OSX/Parse/Parse/Internal/PFInternalUtils.m
Line 245 in 5dad4f2
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 of50
. I suspect most people are batching with < 50 objects so the issue won't show up there.while
loop, it currently isn't doing this properly. Should beindex+length
.<
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-L49The text was updated successfully, but these errors were encountered: