You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Fix spurious notifications on non-live events (#11133)
* Fix notifier not discriminating removed and backpaginated events * Ignore events on the thread list generated timelines * Add test * tsc strict
This commit is contained in:
committed by
GitHub
parent
f73fc496e2
commit
5cf818fefa
@ -538,4 +538,28 @@ describe("Notifier", () => {
|
||||
expect(localStorage.getItem("notifications_hidden")).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
describe("onEvent", () => {
|
||||
it("should not evaluate events from the thread list fake timeline sets", async () => {
|
||||
mockClient.supportsThreads.mockReturnValue(true);
|
||||
|
||||
const fn = jest.spyOn(Notifier, "evaluateEvent");
|
||||
|
||||
await testRoom.createThreadsTimelineSets();
|
||||
testRoom.threadsTimelineSets[0]!.addEventToTimeline(
|
||||
mkEvent({
|
||||
event: true,
|
||||
type: "m.room.message",
|
||||
user: "@user1:server",
|
||||
room: roomId,
|
||||
content: { body: "this is a thread root" },
|
||||
}),
|
||||
testRoom.threadsTimelineSets[0]!.getLiveTimeline(),
|
||||
false,
|
||||
false,
|
||||
);
|
||||
|
||||
expect(fn).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user