Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/models/MSC3089Branch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,14 @@ export class MSC3089Branch {
const room = this.client.getRoom(this.roomId);
if (!room) throw new Error("Unknown room");

const event = room.getUnfilteredTimelineSet().findEventById(this.id);
let event: MatrixEvent | undefined = room.getUnfilteredTimelineSet().findEventById(this.id);

// keep scrolling back if needed until we find the event or reach the start of the room:
while (!event && room.oldState.paginationToken) {
await this.client.scrollback(room, 100);
event = room.getUnfilteredTimelineSet().findEventById(this.id);
}

if (!event) throw new Error("Failed to find event");

// Sometimes the event isn't decrypted for us, so do that. We specifically set `emit: true`
Expand Down