Connect Timeout out of control

Hi
I have problem,
When i move app to background and make app in foreground in seconds,
sendbird sometimes disconnect connection after login.

Maybe connect timeout not handled with logout event. And it take effect to next connection login

final user = await _loginCompleter.future
.timeout(Duration(seconds: options.connectionTimeout), onTimeout: () {
logout();
throw LoginTimeoutError();
});

Hi @maxi,

Are you calling connect multiple times by chance between the app being in the foreground and then you cycling back and forth?

Hi Tyler,
Yes, becase i tried finding why response slowly after app wakeup from background, Finally i remove disconnect and connect between suspend and resume. It’s better now.
Still has a problem.
With release mode , response is immediately. But in debug mode with VSCode, sometimes take 2~3 seconds to get response.

That could be due to the additional overhead of being in debug mode. Could you track the network requests and see if the actual request is taking time to respond?

Http request is fine. But websocket events are slow. There are 20 ~ 30 evnets in eventManager’s queue. But new event waiting for queued taskts and queue looks not working. Tasks in queue are not decrese in 2 ~ 3 seconds.

But this is not an issue in production correct? Only when you have debug enabled?

My manager is worry about that could be happened after release. There is no document about what the different between release and debug mode.Finally, we will wrap native sdk first.

@maxi release vs debug mode is different in many aspects, specially how it compiles (Debug app uses JIT compiler while the release app uses AOT compiler). Because of this, debug mode is much slower than release mode and which is expected. Not exactly sure what events were queued up 20~30 but I haven’t noticed such behavior. Would you explain more what’s circumstance and how you tested?

I have come to experience this problem in debug mode, when the change to profile or release mode is made this disappears.

But I have come to experience a server disconnection problem.
If for any reason the user completely deactivates his internet connection after 2 or 3 calls to the SendBird server, he loses the connection.
Automatic reconnection works but only on the first calls to the server and you must reconnect to the server to continue using the service.
When call getConnectionState this return ConnectionState.closed.

Could this be a stability issue with the package or a bad practice?

What sdk version are you using @RicharC ? and could you elaborate the use case with more details?
I’m not quite sure what exactly your situation is.

Do you mean, for instance, user A disconnects from internet and automatically reconnect once the internet connection comes back?

This phrase I’m quite confused.