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

Fix how Room::eventShouldLiveIn handles replies to unknown parents (#3615)

* Add warning

* Fix how Room::eventShouldLiveIn handles replies to unknown parents
This commit is contained in:
Michael Telatynski
2023-07-24 08:37:28 +01:00
committed by GitHub
parent 38c3abb364
commit 6b018b6927
3 changed files with 22 additions and 2 deletions

View File

@ -3018,6 +3018,14 @@ describe("Room", function () {
expect(responseRelations![0][1].size).toEqual(1);
expect(responseRelations![0][1].has(threadReaction)).toBeTruthy();
});
it("a non-thread reply to an unknown parent event should live in the main timeline only", async () => {
const message = mkMessage(); // we do not add this message to any timelines
const reply = mkReply(message);
expect(room.eventShouldLiveIn(reply).shouldLiveInRoom).toBeTruthy();
expect(room.eventShouldLiveIn(reply).shouldLiveInThread).toBeFalsy();
});
});
describe("getEventReadUpTo()", () => {