From 0945e2c5c6cc1f22fd8bcc51f73fd440c6be802d Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 5 Apr 2019 11:36:01 -0600 Subject: [PATCH] Refuse to set forwards pagination token on live timeline Should fix the error seen in https://github.com/matrix-org/riot-web-rageshakes/issues/1389 (https://github.com/vector-im/riot-web/issues/8593) --- src/models/event-timeline-set.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/models/event-timeline-set.js b/src/models/event-timeline-set.js index 9675f7300..6025b7d77 100644 --- a/src/models/event-timeline-set.js +++ b/src/models/event-timeline-set.js @@ -446,6 +446,14 @@ EventTimelineSet.prototype.addEventsToTimeline = function(events, toStartOfTimel // new information, we update the pagination token for whatever // timeline we ended up on. if (lastEventWasNew || !didUpdate) { + if (direction === EventTimeline.FORWARDS && timeline === this._liveTimeline) { + console.warn({lastEventWasNew, didUpdate}); // for debugging + console.warn( + `Refusing to set forwards pagination token of live timeline ` + + `${timeline} to ${paginationToken}`, + ); + return; + } timeline.setPaginationToken(paginationToken, direction); } };