From 249d52c6f3825838031977cc58a7c89954877614 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 25 May 2022 15:02:14 +0100 Subject: [PATCH] Add additional debug logging for thread timeline mixup (#8693) --- src/components/structures/TimelinePanel.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index 5156ca2eeb..846b78be1f 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -408,7 +408,7 @@ class TimelinePanel extends React.Component { // matrix-js-sdk. let serializedEventIdsFromTimelineSets: { [key: string]: string[] }[]; let serializedEventIdsFromThreadsTimelineSets: { [key: string]: string[] }[]; - const serializedThreadsMap: { [key: string]: string[] } = {}; + const serializedThreadsMap: { [key: string]: any } = {}; if (room) { const timelineSets = room.getTimelineSets(); const threadsTimelineSets = room.threadsTimelineSets; @@ -419,7 +419,15 @@ class TimelinePanel extends React.Component { // Serialize all threads in the room from theadId -> event IDs in the thread room.getThreads().forEach((thread) => { - serializedThreadsMap[thread.id] = thread.events.map(ev => ev.getId()); + serializedThreadsMap[thread.id] = { + events: thread.events.map(ev => ev.getId()), + numTimelines: thread.timelineSet.getTimelines().length, + liveTimeline: thread.timelineSet.getLiveTimeline().getEvents().length, + prevTimeline: thread.timelineSet.getLiveTimeline().getNeighbouringTimeline(Direction.Backward) + ?.getEvents().length, + nextTimeline: thread.timelineSet.getLiveTimeline().getNeighbouringTimeline(Direction.Forward) + ?.getEvents().length, + }; }); }