message: Ensure AsyncStoreWithClient can start mid-lifecycle
  In some cases we're likely to miss the PREPARED sync, so just handle ourselves as ready if we have a client set.
diff: @@ -17,12 +17,25 @@ limitations under the License.
  import { MatrixClient } from "matrix-js-sdk/src/client";
  import { AsyncStore } from "./AsyncStore";
  import { ActionPayload } from "../dispatcher/payloads";
  +import { Dispatcher } from "flux";
  +import { MatrixClientPeg } from "../MatrixClientPeg";
  export abstract class AsyncStoreWithClient<T extends Object> extends AsyncStore<T> {
  protected matrixClient: MatrixClient;
  protected abstract async onAction(payload: ActionPayload);
  + protected constructor(dispatcher: Dispatcher<ActionPayload>, initialState: T = <T>{}) {
  + super(dispatcher, initialState);
  +
  + if (MatrixClientPeg.get()) {
  + this.matrixClient = MatrixClientPeg.get();
  +
  + // noinspection JSIgnoredPromiseFromCall
  + this.onReady();
  + }
  + }
  +
  protected async onReady() {
  // Default implementation is to do nothing.
  }
  @@ -40,8 +53,13 @@ export abstract class AsyncStoreWithClient<T extends Object> extends AsyncStore<
  return;
  }
  + if (this.matrixClient !== payload.matrixClient) {
  + if (this.matrixClient) {
  + await this.onNotReady();
  + }
  this.matrixClient = payload.matrixClient;
  await this.onReady();
  + }
  } else if (payload.action === 'on_client_not_viable' || payload.action === 'on_logged_out') {
  if (this.matrixClient) {
  await this.onNotReady();
  