pubnub / pubnub-angular2

Other
33 stars 13 forks source link

Reconnection event error #15

Closed fsalomon closed 7 years ago

fsalomon commented 7 years ago

I get this error with pubnub-angular2 v1.0.0 and pubnub v4.4.4 every time I reconnect my network.

TypeError: Cannot read property 'forEach' of undefined
    at Object.self.listener.(anonymous function) [as status] (http://localhost:8100/build/main.js:110124:40)
    at http://localhost:8100/pubnub.js:3745:45
    at Array.forEach (native)
    at _class.announceStatus (http://localhost:8100/pubnub.js:3744:29)
    at _class.announceNetworkUp (http://localhost:8100/pubnub.js:3760:18)
    at _class.__networkUpDetected (http://localhost:8100/pubnub.js:398:35)
    at http://localhost:8100/pubnub.js:120:19
    at t.invokeTask (http://localhost:8100/build/polyfills.js:3:9723)
    at Object.onInvokeTask (http://localhost:8100/build/main.js:36872:37)
    at t.invokeTask (http://localhost:8100/build/polyfills.js:3:9659)

I reduced my setup to a single PubNubAngular.init() call.

ManuelFernando commented 7 years ago

@fsalomon this issue is really to associated to pubnub javascript sdk, thanks for reporting this. We are going to check it, can you tell us how is the process to reconnect to your network

fsalomon commented 7 years ago

I'm using Ubuntu 16.04. I just disconnect and reconnect to the network using the network-manager applet. Actually, I'm getting the the same error on disconnect.

ManuelFernando commented 7 years ago

@fsalomon we could reproduce your scenario, thanks for reporting this. A quick question after appearing this issue can you publish and receive messages despite appearing this issue in our case the sdk continues to working.

fsalomon commented 7 years ago

Yes, subscriptions still work, i.e. message events are still fired.