As reported by a user in support (thanks!):
Steps to reproduce
Call some combination of registerWithDeviceToken, subscribe, and unsubscribe concurrently
Expected behavior
Eventually, all the subscribe/unsubscribe calls are processed in the order in which they were called
Actual behavior
This line ...
|
[outbox removeObjectAtIndex:0]; |
... crashes with the error:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM removeObjectAtIndex:]: index 0 beyond bounds for empty array'
Reason
(Hypothesized, not reproduced)
tryFlushOutbox is not threadsafe. Between lookup object at index 0, and then removing the object at index 0, things may have changed. This may happen if tryFlushOutbox is called multiple times: they will interfere with each other.
As reported by a user in support (thanks!):
Steps to reproduce
Call some combination of
registerWithDeviceToken,subscribe, andunsubscribeconcurrentlyExpected behavior
Eventually, all the subscribe/unsubscribe calls are processed in the order in which they were called
Actual behavior
This line ...
libPusher/Library/PTNativePusher.m
Line 123 in 436268e
... crashes with the error:
Reason
(Hypothesized, not reproduced)
tryFlushOutboxis not threadsafe. Between lookup object at index 0, and then removing the object at index 0, things may have changed. This may happen iftryFlushOutboxis called multiple times: they will interfere with each other.