Adjust scheduling of promises and handshaking so that the client only makes one POST request in the best case where WebSocket is connected by the time the handshake completes.