opened
kkaliher
username_0
When running in the simulator only (Xcode 8, Sierra), we often see a crash in TaskQueue after leaving the app running for some time, maybe 10 minutes or so.  It looks like line 129 can enter an infinite loop.

I tried commenting out line 115, if task == nil, and that seemed to help things, but not sure if that is the best approach.
crash in TaskQueue
issue
created
hamchapman
username_1
Thanks for the report - do you have an example that reproduces the issue? Or at least the minimum code needed to reproduce it. 

I've tried to recreate it locally but unsuccessfully thus far.

Thanks!
comment
created
kkaliher
username_0
hey Ham, thanks for the response.  
We reverted this line 115 comment out as that broke push notifications.  
The best approach to the issue here was to just not setup push or subscribe to interests if running on simulator.
comment
closed
kkaliher
username_0
issue
created
esetnik
username_2
I'm seeing the same crash. I think this should be reopened. The library should be able to run without modifications on the simulator. Thanks for the workaround @username_0.
comment
reopened
hamchapman
username_1
When running in the simulator only (Xcode 8, Sierra), we often see a crash in TaskQueue after leaving the app running for some time, maybe 10 minutes or so.  It looks like line 129 can enter an infinite loop.

I tried commenting out line 115, if task == nil, and that seemed to help things, but not sure if that is the best approach.
crash in TaskQueue
issue
created
hamchapman
username_1
Agreed - thanks for the notes guys.

If anyone has some code or a project that exhibits the bug (plus info about which version of Xcode and iOS version + plus device you're using) that would be awesome as I'm still struggling to reproduce it locally.

Thanks!
comment
created
esetnik
username_2
@username_1 I have narrowed down the issue. It occurs when you subscribe to an interest in the simulator when the push notifications cannot be registered. I have created a sample project that reproduces the issue but it contains push notification keys so I'd rather share it with your team privately. If you can provide an email address to send it I'll forward it along.
comment
created
esetnik
username_2
By the way this issue is not limited to the simulator. If a user denies your notification permissions and you still attempt to subscribe to an interest the app will crash after ~5min.
comment
created
hamchapman
username_1
That would be great! My email is my GitHub username @ gmail (.com). Thanks!
comment
created
hamchapman
username_1
I've taken a look at the project and had a play with it and have written up a small fix which I'm still doing some testing on locally just to be sure.

I should have a fix for this ready for review soon!
comment
created
hamchapman
username_1
This pull request should fix this issue https://github.com/pusher/pusher-websocket-swift/pull/100
comment
created
hamchapman
username_1
@username_2, @username_0 have either of you had a chance to test the branch with the proposed fix on it?
comment
created
esetnik
username_2
I have tested the branch containing the fix and I haven't found any crashing issues
comment
created
esetnik
username_2
I tried out your fix and haven't had any issues since.

On Fri, Oct 21, 2016 at 9:28 AM Hamilton Chapman

<
https://github.com/pusher/pusher-websocket-swift/issues/96#issuecomment-255376492
, or
https://github.com/notifications/unsubscribe-auth/AAojcgp7GqKJDEei7ecWbVZ1YrvbS8xwks5q2L3igaJpZM4KPOS6
.
comment
created
esetnik
username_2
Can this get merged in?
comment
created
hamchapman
username_1
I was just working on this today. It should be merged in tomorrow, along with some changes to how the delegates are implemented on the connection and top level Pusher objects.
comment
created
hamchapman
username_1
Took longer than expected to get to this - will be releasing the new version today.
comment
closed
hamchapman
username_1
issue
created
hamchapman
username_1
Just pushed a new version (4.0.0). A few breaking changes around the `PusherDelegate` and `PusherConnectionDelegate` but shouldn't be too big a deal.
comment