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
This commit is contained in:
Eric Eastwood 2023-04-27 03:16:06 -05:00 committed by GitHub
parent 53a1d4b43b
commit addb02198d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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);
}
}
});
},