Closed vincentneo closed 1 year ago
The network looks much worse than 3G. Round-trip time of 6.425648 seconds for small request used by TDLib suggests that also aggressive packet drop is enabled, or an artificial delay is introduced. Default timeout for NSURLSession.sharedSession
is 60 seconds, which is confirmed by "Last pong was in 60.084104" logging from TDLib. If a small HTTP request can't succeed for 60 seconds, then the app can hardly work on such network.
The earlier updateAuthorizationState
that I received arrived pretty quickly though.
These are the settings:
Interesting that now even with Network Link Conditioner turned off, I am still getting no response from requestQrCodeAuthentication
(not even an ok/error btw) Similar timeout messages are observed.
No problems with another simulator that was already logged in since many days ago.
By the way assuming the 60s timeout behaviour, assuming if device momentarily loses connection for let's say 61s, will TDLib fail to continue receiving updates after device regain connection at 62s? (and user would have to re-open the app?)
TDLib will complete all request whenever network become accessible.
@levlam Now I swear that something is wrong with the QR code requestor on the backend. Nothing to do with speed I guess.
My current app on the store is on TDLib 1.8.12, and hasn't ever had a problem until this week. The build I tested when I tested for this issue was on 1.8.14, which suggest the version difference wasn't a problem at least for this.
I received 4 complains so far in the short span of a week, can't be a coincidence right? App on 1.8.12 hasn't changed since late March, so there must be something wrong.
btw I've sent a file to the tdlib bot, verbosity level 1000
Seems like I can get a QR code now, for both IPv4 and IPv6 modes. That said, still occasionally receiving random timeouts, even though things seem to be working.
Will check again tomorrow, if all's good I'll close both issues.
This should be fixed now.
Works for me, though there's one user that is still facing problems logging in, last reported about 3 hours ago. Will advice the user to try again.
Other than 1 user, rest seems to be logging in fine. Will close, thanks for the help!
~I wanted to test on what would happen if a user happens to be using the app with bad network conditions, so I tested my app which uses TDLib, using macOS's Network Link Conditioner, set to "3G" profile, and running watchOS on simulator.~
It appears issue is with more with logging in rather than with slow networks as I initially suspected.
I realised that after receiving
updateAuthorizationState
with the state ofauthorizationStateWaitPhoneNumber
, after calling ofrequestQrCodeAuthentication
, I do not get anotherupdateAuthorizationState
, which should return the state ofauthorizationStateWaitOtherDeviceConfirmation
.Instead, I see logs like this in the console.
Note that it only happens on slow connections/with the link conditioner on. For
td_receive()
's timeout, I have tried both 2s and 100s, with the same result.I am also investigating on why it seems some update calls get dropped at random, which lead to this investigation and finding of this issue.