1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-07-30 04:23:07 +03:00

Fix threads ending up with chunks of their timelines missing (#3618)

* Fix threads ending up with chunks of their timelines missing

* delint
This commit is contained in:
Michael Telatynski
2023-07-25 16:28:52 +01:00
committed by GitHub
parent de7959de6c
commit 8a80886358
4 changed files with 35 additions and 16 deletions

View File

@ -703,7 +703,11 @@ async function createThread(client: MatrixClient, user: string, roomId: string):
root.setThreadId(root.getId());
await room.addLiveEvents([root]);
return room.createThread(root.getId()!, root, [], false);
// Create the thread and wait for it to be initialised
const thread = room.createThread(root.getId()!, root, [], false);
await new Promise<void>((res) => thread.once(RoomEvent.TimelineReset, () => res()));
return thread;
}
/**