zalmoxisus / remotedev

Remote debugging for any flux architecture.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unsubscribe in connect() is broken - handles instanceId incorrectly

rob3c opened this issue · comments

Hi, first of all, thanks for this handy module! I've managed to get it working with Ionic 2 and @ngrx/store (via @ngrx/store-devtools) for on-device remote debugging via a custom wrapper, and the inspector is working nicely!

The only minor issue I'm running into with remotedev is the way unsubscribe() is handled in the connect() function. It mistakenly assumes that the instanceId is an array index instead of the configured value in the connect options. Therefore, it never actually unsubscribes anything when it's called. (I see your chrome extension code handles this fine and just needs to be ported over here.)

Coincidentally, there's also a complementary bug that kind of neutralizes the problem in @ngrx/store-devtools, where they're calling unsubscribe() immediately upon subscription in their Observable wrapper instead of returning a lambda to call it (I'll be creating an issue over there soon as well). So this bug is temporarily allowing update actions to still be received by ngrx even though it's being called immediately after subscribe() lol. Unfortunately, it doesn't actually handle them correctly for time travel to work, but that's another issue to hopefully be resolved soon on their end.

Hi! You're right. I fixed that in 0.2.3. Let me know if it works.

Wow, that was fast :-) That did it - thanks!