diff --git a/src/matrix/room/timeline/persistence/GapWriter.js b/src/matrix/room/timeline/persistence/GapWriter.js index cfdefbd6..f64b1690 100644 --- a/src/matrix/room/timeline/persistence/GapWriter.js +++ b/src/matrix/room/timeline/persistence/GapWriter.js @@ -105,7 +105,7 @@ export class GapWriter { // e.g. order is moving away from the `from` point. let key = startKey; for (let i = 0; i < events.length; ++i) { - const event = events[0]; + const event = events[i]; key = key.nextKeyForDirection(direction); const eventStorageEntry = createEventEntry(key, this._roomId, event); const memberEvent = this._findMemberEvent(event.sender, state, events, i, direction);