-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Description
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 ...
libPusher/Library/PTNativePusher.m
Line 123 in 436268e
| [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.
Metadata
Metadata
Assignees
Labels
No labels