message: Add extra TimelinePanel logging to debug specific issue
diff: @@ -383,7 +383,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
  * every message change so instead we only log it out when asked.
  */
  private onDumpDebugLogs = (): void => {
  - const roomId = this.props.timelineSet.room?.roomId;
  + const room = this.props.timelineSet.room;
  // Get a list of the event IDs used in this TimelinePanel.
  // This includes state and hidden events which we don't render
  const eventIdList = this.state.events.map((ev) => ev.getId());
  @@ -408,8 +408,6 @@ class TimelinePanel extends React.Component<IProps, IState> {
  let serializedEventIdsFromTimelineSets: { [key: string]: string[] }[];
  let serializedEventIdsFromThreadsTimelineSets: { [key: string]: string[] }[];
  const serializedThreadsMap: { [key: string]: string[] } = {};
  - const client = MatrixClientPeg.get();
  - const room = client?.getRoom(roomId);
  if (room) {
  const timelineSets = room.getTimelineSets();
  const threadsTimelineSets = room.threadsTimelineSets;
  @@ -424,15 +422,20 @@ class TimelinePanel extends React.Component<IProps, IState> {
  });
  }
  + const timelineWindowEventIds = this.timelineWindow.getEvents().map(ev => ev.getId());
  + const pendingEvents = this.props.timelineSet.getPendingEvents().map(ev => ev.getId());
  +
  logger.debug(
  - `TimelinePanel(${this.context.timelineRenderingType}): Debugging info for ${roomId}\n` +
  + `TimelinePanel(${this.context.timelineRenderingType}): Debugging info for ${room?.roomId}\n` +
  `\tevents(${eventIdList.length})=${JSON.stringify(eventIdList)}\n` +
  - `\trenderedEventIds(${renderedEventIds ? renderedEventIds.length : 0})=` +
  + `\trenderedEventIds(${renderedEventIds?.length ?? 0})=` +
  `${JSON.stringify(renderedEventIds)}\n` +
  `\tserializedEventIdsFromTimelineSets=${JSON.stringify(serializedEventIdsFromTimelineSets)}\n` +
  `\tserializedEventIdsFromThreadsTimelineSets=` +
  `${JSON.stringify(serializedEventIdsFromThreadsTimelineSets)}\n` +
  - `\tserializedThreadsMap=${JSON.stringify(serializedThreadsMap)}`,
  + `\tserializedThreadsMap=${JSON.stringify(serializedThreadsMap)}\n` +
  + `\ttimelineWindowEventIds(${timelineWindowEventIds.length})=${JSON.stringify(timelineWindowEventIds)}\n` +
  + `\tpendingEvents(${pendingEvents.length})=${JSON.stringify(pendingEvents)}`,
  );
  };
  