Closed beeb closed 8 years ago
I haven't seen that issue come up for me, do you know how to reproduce it? Does it always happen on the same requests? And could you check what request types are in subResponseConverters
, and how many elements are response.returns
array when you experience the crash?
Haven't been able to reproduce yet but if it happens again I will be able to provide this information.
I actually managed to reproduce this today, but unfortunately it was while the debugger wasn't connected 😕. I've implemented a fix that should stop it from crashing, at the expense of not returning all the data if this does happen. I'll only get a chance to push it later though, I'm not at my computer right now
Alright I implemented a similar fix myself (with a condition to print the problematic data if the index of out of range), I'll report if I see something.
Got the error again. subResponseConverters
had 1 entry:
[(.GetMapObjects, pgoapi.ProtoBufDataConverter<ProtocolBuffers.GeneratedMessage>(convertFunc: (Function)))]
while response.returns
had 2 elements
Were you requesting anything other than the map objects? If not, it looks like the server is returning extra data not requested by the client. As long as the extra data is after the map object data in the array we should be fine to just ignore the unnecessary supplemental data.
I confirm I was only requesting map objects, I think you're right and the additional condition is sufficient to prevent the runtime error.
I'm going to assume the extra data is at the end of the array, and close this issue for now. We can reopen it if anything comes up to suggest otherwise.
Fixed in 4fe043accc8d459c5c60f3437bcecec8d3dd8ca6. Thanks for the help tracking this down 👍
Hey there,
I sometimes get an
index out of range
error on line 46 ofApiResponseDataConverter.swift
:Do you also encounter this error sometimes?