-
Notifications
You must be signed in to change notification settings - Fork 19
Timeout exceeded after socket reconnected #64
Comments
@ekryski @daffl @marshallswain I'm stuck in the water on this one. I tried to work around it by doing an Do you have any suggestions on how to gracefully reauthenticate the socket from the client if the server instigates the logout on a ping timeout? |
Can you share the relevant part of your application setup? If the service calls are happening before authentication it might just be in the wrong place. |
I believe the issue is that the service call (i.e. My temp hack is set set the timeout low and use class Application extends React.PureComponent {
@observable appState = AppState.currentState
state = {
loading: false
}
appStateListener = async (nextAppState) => {
console.log("appState", nextAppState)
if (
this.appState.match(/inactive|background/) &&
nextAppState === "active"
) {
console.log("Reconnecting...")
this.setState({ loading: true })
// TODO https://github.com/feathersjs/feathers-authentication-client/issues/64
try {
await app().authenticate()
} catch (e) {
//swallow
} finally {
this.setState({ loading: false })
}
}
this.appState = nextAppState
}
} |
@daffl I think @corymsmith and I had this issue on a previous app. We ended up having to mess with the socket timeout for every service on our RN app. However, I think that was only before this PR landed. @corymsmith might have a bit more context. |
I'm running into this as well. |
There was a discussion and nobody involved followed up on it. For React Native specifically there is documentation how to set the timeouts at https://docs.feathersjs.com/api/client.html#react-native |
All reconnection issues should be fixed in Feathers v4 authentication. Please see the migration guide for more information. Closing this issue in order to archive this repository. Related issues can be opened at the new code location in the Feathers main repository. |
Steps to reproduce
DEBUG=* npm start
feathers-authentication:sockets:handler Successfully logged out socket with accessToken...
Timeout of 5000ms exceeded calling blah:find
I enabled
debug()
to track the feathers* logging in react native dev tools. Here are the important lines:Not sure if this is relevant, but the call to socket.emit happens before socket reconnected/authenticated event.
Alternatively, if I restore the app and wait 60s or so, the app will auto-reconnect, re-auth the socket and behave normally from there.
Expected behavior
The call to the service should not timeout
Actual behavior
Service call times out
System configuration
Tested using Android SDK 25 in emulator
Module versions (especially the part that's not working):
Client
Server
React Native Version:
0.46.4
The text was updated successfully, but these errors were encountered: