message: Don't handle user activity if the bridge isn't running
diff: @@ -86,7 +86,7 @@ export class IrcBridge {
  private memberListSyncers: {[domain: string]: MemberListSyncer} = {};
  private joinedRoomList: string[] = [];
  private dataStore!: DataStore;
  - private startedUp = false;
  + private bridgeState: "not-started"|"running"|"killed" = "not-started";
  private debugApi: DebugApi|null = null;
  private provisioner: Provisioner|null = null;
  private bridge: Bridge;
  @@ -782,7 +782,7 @@ export class IrcBridge {
  log.info("Startup complete.");
  - this.startedUp = true;
  + this.bridgeState = "running";
  }
  private logMetric(req: Request<BridgeRequestData>, outcome: string) {
  @@ -871,7 +871,7 @@ export class IrcBridge {
  }
  public get isStartedUp() {
  - return this.startedUp;
  + return this.bridgeState === "running";
  }
  private async joinMappedMatrixRooms() {
  @@ -1528,10 +1528,14 @@ export class IrcBridge {
  return current >= limit;
  }
  - private onUserActivityChanged(userActivity: UserActivityState) {
  + private async onUserActivityChanged(userActivity: UserActivityState) {
  + if (!this.isStartedUp) {
  + // Only handle activity if we're running
  + return;
  + }
  for (const userId of userActivity.changed) {
  - this.getStore().storeUserActivity(userId, userActivity.dataSet.users[userId]);
  + await this.getStore().storeUserActivity(userId, userActivity.dataSet.users[userId]);
  }
  - this.bridgeBlocker?.checkLimits(userActivity.activeUsers);
  + await this.bridgeBlocker?.checkLimits(userActivity.activeUsers);
  }
  }
  