AuthorizationStateLoggingOut never finishes (tdlib v1.8.20, java)
Steps to reproduce (both in test dc and prod)
Launch Example.java
Log in using phone and code, eg 9996623336 and 22222
Log out by typing lo
"Logging out" is printed to the console, followed by "Ok { }" after a few seconds indicating it has been completed successfully.
I see in my telegram application, that this session is correctly removed after TdApi.LogOut(), so it works, at least partially.
But then application just hangs.
Javadoc for LogOut says it should end up closing client, deleting local data and triggering authorizationStateClosed after some time, but it doesn't.
Any subsequent restarts of the Example.java end up hanging with the same message "Logging out" as well, due to tdlib catching AuthorizationStateLoggingOut event on application start-up. Only this time it isn't followed by "Ok { }".
The only way I managed to fix this is to:
After calling TdApi.LogOut(), wait until TdApi.LogOut() callback finishes
Call TdApi.Close() and wait until it's callback finishes
Delete entire databaseDirectory
Recreate client using Client.create()
Now it's possible to login using another phone number and continue work
Seems hacky, and the documentation says it should be done automatically.
Is this solution suitable for production?
Running in ubuntu 22.04 under WSL2
Eclipse Temurin JDK 21
Logs from test dc and log verbosity level 4: tdlib.log
AuthorizationStateLoggingOut never finishes (tdlib v1.8.20, java)
Steps to reproduce (both in test dc and prod)
9996623336
and22222
lo
"Logging out" is printed to the console, followed by "Ok { }" after a few seconds indicating it has been completed successfully.
I see in my telegram application, that this session is correctly removed after
TdApi.LogOut()
, so it works, at least partially.But then application just hangs.
Javadoc for
LogOut
says it should end up closing client, deleting local data and triggeringauthorizationStateClosed
after some time, but it doesn't.Any subsequent restarts of the Example.java end up hanging with the same message "Logging out" as well, due to tdlib catching
AuthorizationStateLoggingOut
event on application start-up. Only this time it isn't followed by "Ok { }".The only way I managed to fix this is to:
TdApi.LogOut()
, wait untilTdApi.LogOut()
callback finishesTdApi.Close()
and wait until it's callback finishesdatabaseDirectory
Client.create()
Seems hacky, and the documentation says it should be done automatically.
Is this solution suitable for production?
Running in ubuntu 22.04 under WSL2 Eclipse Temurin JDK 21 Logs from test dc and log verbosity level 4: tdlib.log