From 8325c5934dc3befbe3f0537601f606dabfc952ae Mon Sep 17 00:00:00 2001 From: Kegan Dougal <7190048+kegsay@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:34:14 +0100 Subject: [PATCH] Debug logging --- src/components/structures/TimelinePanel.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index f4c9b639ac..1d71b28c55 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -319,6 +319,7 @@ class TimelinePanel extends React.Component { } public componentDidMount(): void { + console.log("componentDidMount"); if (this.props.manageReadReceipts) { this.updateReadReceiptOnUserActivity(); } @@ -364,6 +365,7 @@ class TimelinePanel extends React.Component { } public componentWillUnmount(): void { + console.log("componentWillUnmount"); // set a boolean to say we've been unmounted, which any pending // promises can use to throw away their results. // @@ -704,6 +706,7 @@ class TimelinePanel extends React.Component { removed: boolean, data: IRoomTimelineData, ): void => { + console.log("onRoomTimeline ", ev, room, "toStart:",toStartOfTimeline, "removed:",removed,"data:",data); // ignore events for other timeline sets if ( data.timeline.getTimelineSet() !== this.props.timelineSet && @@ -711,7 +714,6 @@ class TimelinePanel extends React.Component { ) { return; } - if (!Thread.hasServerSideSupport && this.context.timelineRenderingType === TimelineRenderingType.Thread) { if (toStartOfTimeline && !this.state.canBackPaginate) { this.setState({ @@ -810,6 +812,7 @@ class TimelinePanel extends React.Component { } private onRoomTimelineReset = (room: Room | undefined, timelineSet: EventTimelineSet): void => { + console.log("onRoomTimelineReset", room, timelineSet); if (timelineSet !== this.props.timelineSet && timelineSet !== this.props.overlayTimelineSet) return; if (this.canResetTimeline()) { @@ -1425,6 +1428,7 @@ class TimelinePanel extends React.Component { }; private initTimeline(props: IProps): void { + console.log("initTimeline"); const initialEvent = props.eventId; const pixelOffset = props.eventPixelOffset; @@ -1534,6 +1538,7 @@ class TimelinePanel extends React.Component { * @param {boolean?} scrollIntoView whether to scroll the event into view. */ private loadTimeline(eventId?: string, pixelOffset?: number, offsetBase?: number, scrollIntoView = true): void { + console.log("loadTimeline"); const cli = MatrixClientPeg.safeGet(); this.timelineWindow = new TimelineWindow(cli, this.props.timelineSet, { windowLimit: this.props.timelineCap }); this.overlayTimelineWindow = this.props.overlayTimelineSet @@ -1542,7 +1547,7 @@ class TimelinePanel extends React.Component { const onLoaded = (): void => { if (this.unmounted) return; - + console.log("loadTimeline -> onLoaded"); // clear the timeline min-height when (re)loading the timeline this.messagePanel.current?.onTimelineReset(); this.reloadEvents(); @@ -1590,6 +1595,7 @@ class TimelinePanel extends React.Component { const onError = (error: MatrixError): void => { if (this.unmounted) return; + console.log("loadTimeline -> onError", error); this.setState({ timelineLoading: false }); logger.error(`Error loading timeline panel at ${this.props.timelineSet.room?.roomId}/${eventId}`, error); @@ -1644,7 +1650,7 @@ class TimelinePanel extends React.Component { onLoaded(); return; } - + console.log("calling timelineWindow.load"); const prom = this.timelineWindow.load(eventId, INITIAL_SIZE).then(async (): Promise => { if (this.overlayTimelineWindow) { // TODO: use timestampToEvent to load the overlay timeline @@ -1685,6 +1691,7 @@ class TimelinePanel extends React.Component { // get the list of events from the timeline windows and the pending event list private getEvents(): Pick { + console.log("getEvents"); const mainEvents = this.timelineWindow!.getEvents(); let overlayEvents = this.overlayTimelineWindow?.getEvents() ?? []; if (this.props.overlayTimelineSetFilter !== undefined) {