message: fix: xmpp attach failure results in start failure
diff: @@ -50,10 +50,15 @@ function attachConnection(url: string, jid: string, sid: string, rid: string) {
  }
  function resolveConnectionPromise(status, condition, connection, resolve, reject) {
  - //@REVIEW how can this be removed after the promise resolves
  + let attachTimeout;
  +
  switch (status) {
  case Strophe.Status.DISCONNECTED:
  case Strophe.Status.CONNFAIL:
  + if (attachTimeout) {
  + clearTimeout(attachTimeout);
  + }
  +
  reject(new ConnectionError(condition));
  break;
  case Strophe.Status.AUTHFAIL:
  @@ -62,6 +67,16 @@ function resolveConnectionPromise(status, condition, connection, resolve, reject
  case Strophe.Status.ATTACHED:
  // flush connection in order we reuse a rid
  connection.flush();
  + attachTimeout = setTimeout(() => {
  + // attached doesn't mean the connection is working, but if something
  + // is wrong the server will immediately response with a connection failure.
  + resolve({
  + connection,
  + status,
  + condition
  + });
  + }, 1000);
  + break;
  case Strophe.Status.CONNECTED:
  resolve({
  connection,
  