To the DDP experts: Sometimes login method won't send results

I am using a custom C# DDP library to connect to my server, using an unstable mobile connection. Since it’s a mobile device, it might go to sleep anytime.

So I check on wakeup if the WebSocket connection has been broken. If so, I re-connect and resume the session with an login message (method call) with a resume token.

This works most of the times. The server first responses with an UPDATE on the method, and then with a RESULT containing a the same token, a user id and an expiry date.

However, somestimes, the UPDATE is sent, but not the RESULT. This causes my app to “hang”, because the login handshake hasn’t completed.

I am wondering why this happens. Could it be that the server won’t send a result on a login request if it thinks that it’s still connected (although the client thinks otherwise)?

I tried to workaround this by calling logout immediately before login. Not sure if this is a valid approach in the first place, i.e. is it safe to re-use a resume token even after the user has logged out?

how can you use the resume token after calling logout? I think by calling logout the server will destroy the token.

No, it seems as if the server keeps these tokens forever. They actually kinda spam your user account.