From addb02198d756a3ee63e8a24c9c6072bf8928266 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Thu, 27 Apr 2023 03:16:06 -0500 Subject: [PATCH] Don't jump calendar around for events which appear in the future (#196) Don't jump calendar around for events which appear in the future compared to the timestamp in the URL. This sort of situation occurs often for Gitter imported historical rooms where we have a bunch of history that is timestamp massaged intermixed with a bunch of join events which we couldn't timestamp massage at the time. Fix https://github.com/matrix-org/matrix-public-archive/issues/182 --- shared/views/ArchiveRoomView.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shared/views/ArchiveRoomView.js b/shared/views/ArchiveRoomView.js index d3cef76..d7b791e 100644 --- a/shared/views/ArchiveRoomView.js +++ b/shared/views/ArchiveRoomView.js @@ -185,7 +185,11 @@ class ArchiveRoomView extends TemplateView { if (entry.isIntersecting) { const eventId = entry.target.getAttribute('data-event-id'); const eventEntry = vm.eventEntriesByEventId[eventId]; - vm.setCurrentTopPositionEventEntry(eventEntry); + + // Ignore events which appear in the future + if (eventEntry.timestamp <= vm.dayTimestampTo) { + vm.setCurrentTopPositionEventEntry(eventEntry); + } } }); },