I think I would prefer this to be in tryPresenceSocket as that's where the sign-in is actually initiated and is clearer in the case when we're still waiting on getting the configuration.

Also, createPresenceSocket is missing a _loginPending = true as well.

I think controlling the _loginPending in the functions handling the websocket connection will be clearer than having it handled in separate locations.