message: Reset this.messages on open/close/error. Early return in flushMessages_.
diff: @@ -201,15 +201,18 @@ class EventStream extends SafetyFirst {
  this.flushMessages();
  })
  .onopen(() => {
  + this.messages = {};
  this.setState({error: false, loading: false, sortedMessages: [], filteredMessages: []});
  })
  .onclose(evt => {
  if (evt && evt.wasClean === false) {
  this.setState({error: evt.reason || 'WebSocket closed uncleanly.'});
  }
  + this.messages = {};
  this.setState({sortedMessages: [], filteredMessages: []});
  })
  .onerror(() => {
  + this.messages = {};
  this.setState({error: true, sortedMessages: [], filteredMessages: []});
  });
  }
  @@ -270,7 +273,9 @@ class EventStream extends SafetyFirst {
  // Instead of calling setState() on every single message, let onmessage()
  // update an instance variable, and throttle the actual UI update (see constructor)
  flushMessages_ () {
  - if (!_.isEmpty(this.messages)) {
  + if (_.isEmpty(this.messages)) {
  + return;
  + }
  // In addition to sorting by timestamp, secondarily sort by name so that the order is consistent when events have
  // the same timestamp
  const sorted = _.orderBy(this.messages, ['lastTimestamp', 'name'], ['desc', 'asc']);
  @@ -285,7 +290,6 @@ class EventStream extends SafetyFirst {
  // Shrink this.messages back to maxMessages messages, to stop it growing indefinitely
  this.messages = _.keyBy(sorted, 'metadata.uid');
  }
  - }
  toggleStream_ () {
  this.setState({active: !this.state.active}, () => {
  