When the flipper client temporarily disconnects, an Unhandled Exception occurs.
Reproduction
Install flipper as normal
Connect and receive redux events
Close flipper, send another redux action from the app
expected Actions work as expected
actual
[Unhandled promise rejection: Error: Cannot send data, not connected]
at node_modules/react-native-flipper/index.js:45:12 in Connection#send
at node_modules/redux-flipper/lib/index.js:74:16 in <anonymous>
at node_modules/@reduxjs/toolkit/dist/query/rtk-query.cjs.development.js:1319:29 in <anonymous>
at node_modules/@reduxjs/toolkit/dist/query/rtk-query.cjs.development.js:1217:29 in <anonymous>
at node_modules/@reduxjs/toolkit/dist/query/rtk-query.cjs.development.js:1177:25 in <anonymous>
at node_modules/@reduxjs/toolkit/dist/query/rtk-query.cjs.development.js:1091:29 in <anonymous>
at node_modules/@reduxjs/toolkit/dist/query/rtk-query.cjs.development.js:1040:25 in <anonymous>
at node_modules/@reduxjs/toolkit/dist/query/rtk-query.cjs.development.js:1002:29 in <anonymous>
at node_modules/@reduxjs/toolkit/dist/query/rtk-query.cjs.development.js:1376:29 in <anonymous>
at node_modules/@reduxjs/toolkit/dist/query/rtk-query.cjs.development.js:1405:30 in <anonymous>
at node_modules/@reduxjs/toolkit/dist/redux-toolkit.cjs.development.js:370:39 in <anonymous>
at node_modules/@reduxjs/toolkit/dist/redux-toolkit.cjs.development.js:1201:44 in __generator$argument_1
at node_modules/@sentry/integrations/node_modules/tslib/tslib.js:141:21 in step
at node_modules/@sentry/integrations/node_modules/tslib/tslib.js:122:60 in <anonymous>
at node_modules/@reduxjs/toolkit/dist/redux-toolkit.cjs.development.js:109:13 in Promise$argument_0
at node_modules/@reduxjs/toolkit/dist/redux-toolkit.cjs.development.js:91:11 in __async
at node_modules/@reduxjs/toolkit/dist/redux-toolkit.cjs.development.js:1153:30 in <anonymous>
at node_modules/@reduxjs/toolkit/dist/redux-toolkit.cjs.development.js:1152:26 in <anonymous>
at node_modules/@reduxjs/toolkit/dist/redux-toolkit.cjs.development.js:370:39 in <anonymous>
at src/providers/Urql.js:91:14 in Promise$argument_0
at src/providers/Urql.js:90:25 in useCallback$argument_0
at src/providers/Urql.js:85:40 in useCallback$argument_0
at src/providers/Urql.js:116:23 in useCallback$argument_0
at [native code]:null in callFunctionReturnFlushedQueue
On the onDisconnect event I believe currentConnection just needs to return to null. The try/catch approach in #20 would also work.
✅ I'm comfortable submitting a PR for this if needed
Summary
When the flipper client temporarily disconnects, an Unhandled Exception occurs.
Reproduction
expected Actions work as expected
actual
On the
onDisconnect
event I believecurrentConnection
just needs to return tonull
. The try/catch approach in #20 would also work.✅ I'm comfortable submitting a PR for this if needed