zalmoxisus / remote-redux-devtools

Redux DevTools remotely.
http://zalmoxisus.github.io/monitoring/
MIT License
1.81k stars 139 forks source link

Socket connection failed for unknown reasons with redux-thunk on react-native #50

Closed Asp3ctus closed 7 years ago

Asp3ctus commented 8 years ago

Hi I have react-native app, and i have redux-thunk middleware.

If i dispatch a thunk function, which is Promise and dispatches another tunk function in it self everythink works, exept in a few seconds remote-redux-devtools get disconnected. https://github.com/zalmoxisus/remote-redux-devtools/blob/master/src/devTools.js#L191

Aplications works as expected, remote debug works, console.logs works ..

But the redux-devtools stops working.

I can provide and example app, i have tried to debug it but with no success.

Asp3ctus commented 8 years ago

well, i have more info: 1) i have redux-persist 2) then my configureStore is finished creating store and loading from persist a callback is called 3) in callback if i dispatch redux-thunk action inside redux-think action then the socket is disconected.

But if i do 4 second timeout and call the same action everythink works and socket is not disconnected. i have tried less then 4 seconds and it is not helping like 4 seconds timeout...

zalmoxisus commented 8 years ago

Thanks for the report. Could you please try to replicate it with remote-redux-devtools@0.5.0 (in case you used 0.5.1)? As it could be related to today's update. Also try to use local remotedev-server so you'll see what throws on the backend.

When the connection is lost (due to an exception in your case), the client automatically reconnects, so waiting about 4 seconds for that is as expected. We just need to fix the exception on the backend. Debugging remotedev-server or providing a repo to reproduce would help.

Related to https://github.com/jhen0409/remote-redux-devtools-on-debugger/issues/15.

Asp3ctus commented 8 years ago

well i had this issue for 3-4 weeks now, i had 0.5.0 before and updated to 0.5.1 today and it was the same. thanks for response and linking it to related issue i'll give it a try, and i'll post the results

mmmurf commented 8 years ago

I appear to be having this issue as well. With 0.5.2 it's still happening.

zalmoxisus commented 7 years ago

@mmmurf are you using it with default configuration (without specifying host and port)? Then try if you can replicate the problem with remotedev-server.

Ldoppea commented 7 years ago

Hi,

I think that I have the same error as @Asp3ctus in my project. The reason is that I dispatch a very very big action (hundred of gps points) as reported by the issue referenced by @zalmoxisus .

I tried to run my project with older versions of remote-redux-devtools and socketcluster-client but then new errors appears with webpack so I don't know if the socket bug is fixed.

Here is a way to reproduce the error :

image

zalmoxisus commented 7 years ago

@Ldoppea thanks for the example, I'll give it a try. However, if you're using remotedev.io it has client_max_body_size set to 1m, which is default for nginx. Do you have this problem also when running remotedev-server locally? Its payload is limited to 16mb.

Ldoppea commented 7 years ago

@zalmoxisus Great, it seems to fix the problem. I didn't know that remotedev.io was used by default.

With remotedev.io socket starts to crash with : largeobj: _.times(50000, i => { ..... }) With remotedev-server socket starts to crash with : largeobj: _.times(800000, i => { ..... } })

That is large enough for my project :)

@Asp3ctus does that fix your problem too?

brunolemos commented 7 years ago

@zalmoxisus finally fixed my remote devtools being empty by switching to local server, thanks!

zalmoxisus commented 7 years ago

I've increased client_max_body_size of remotedev.io to 16m, which should prevent this issue. Thanks a lot for the investigations!