Closed xspire closed 2 weeks ago
We provided worked example for managing Internet state in our Chat sample. Which problem do you have with this implementation?
State of SDK is very often frozen in Reconnecting, Authenticated, SocketOpening,.. when changing between wifi and LET. To escape this stat, restart app. I have not yet fined a solution for this situation. I am spending 5 month for this issue.
have you reviewed my link? there we try to reconnect to the chat if the chat connection state changed to Closed
or ForceClosed
and connectivityType != ConnectivityResult.none
. Or vice versa, when the connection state is changed to connectivityType != ConnectivityResult.none
we check the state of the chat connection and try to reconnect if need.
Of course, I have used the activity_plus and app lifecycle hander. I mean that xmpp_stone state in connectycube api is holded freezied on a several state. FinaIly, i use watchdog to escape this situation, but the freezing state is not solved. Watchdog has been builded for checking holding state in any state what is not ready. When watchdog timeout is fired, recreate a session and chat login. I used the relogin function of connectycube sdk before, but it didn't work in any wifi, LTE situation. Also ConnectyCube SDK is freezied.
@TatankaConCube xmpp_stone is not adaptive to the Wi-Fi changing situation. (ex, iphone's personal hotspot and other wifi) You should check that mismatch between CubeChatConnectionState and XmppConnectionState. How to reset xmpp_stone connection ?
@TatankaConCube onConnectivityChanged handler of Connectivity does not be called when change any wifi to hotspot wifi.
Under stable wifi state, two xmpp message is periodically outputted with 5 seconds. That is "r xmlns="urn:xmpp:sm:3"" and "a xmlns='urn:xmpp:sm:3' h='69'".
But when wifi is exchanged, only one xmpp debug message is appeared. That is "r xmlns="urn:xmpp:sm:3"".
No handler is not called.
After about 3 minute, suddenly Outputing "CubeChatConnection: Chat connection ForcefullyClosed" debug message is started. After a moments, the connection is recovered.
I want to shrink the 3 minute. Where can i fix it ?
@TatankaConCube Socket Timeout is estimated at 6 minute.
@TatankaConCube I can't fined a timeout variable for handleSecuredConnectionError exception event what in Connection.dart of xmpp_stone. It is very serious.
Before about 6 minute, CubeChatConnection.instance.login does not return or call catError. If user restart app before 6 minute, Login is success. Is this a server issue too ? Where are you ?
Have you try to use method CubeChatConnection.instance.relogin
instead of CubeChatConnection.instance.login
? Could you please attach here full log from flutter console?
relogin and login, logout function is all failed after when device's ip is changed.
I find that xmpp's _socket is not destroyed when device's ip is changed. _socket?.destroy() code is not used anywhere in xmpp_stone and connectycube sdk.
Please check https://pub.dev/packages/network_info_plus flutter plugin.
Plesase test your flutter sample and improve your sdk for a daily use. I am spending my time too much for keeping online of your sdk.
Which version of our SDK do you use? How can we reproduce the same issue in our sample?
I am using ConntctyCube ver 2.0.2.
Test sequence.
@TatankaConCube Is there any activity ?
no activity for a long time, closing.
I have one suggestion for ConnectyCube SDK.
Add a management for AppLifecycleState and ConnectivityResult to ConnectyCube SDK.
This is to allow developers to determine the app state by looking only at the CubeChatConnectionState state value.
We found a situation that xmpp_stone in ConnectyCube SDK does not accurately reflect the current device state.
Sometimes, xmpp_stone is holded in a several state ( xmpp.XmppConnectionState.Authenticated, SocketOpening ... ) in a situation what internet connection is very often changed between wifi and LTE.
It is very defficult that developer manage the online connection.
Currently, is there perfect connection management solution for an unstable internet connection with ConnectyCube SDK ?
I spent too much time for stabilizing internet connection management with ConnectyCube SDK.
Ps : I use flutter Connectivity_plus plugin package for internet connection management.