-
-
Notifications
You must be signed in to change notification settings - Fork 811
Fix unwanted ringing of other devices even though the user is already connected to the call. #12742
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,10 @@ import { | |
| SyncState, | ||
| } from "matrix-js-sdk/src/matrix"; | ||
| import { waitFor } from "@testing-library/react"; | ||
| // eslint-disable-next-line no-restricted-imports | ||
| import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; | ||
| // eslint-disable-next-line no-restricted-imports | ||
| import { CallMembership } from "matrix-js-sdk/src/matrixrtc/CallMembership"; | ||
|
Comment on lines
+29
to
+32
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. Seems like
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for making me finally take care of this... I dont think this fits into this PR and I would like to not block this PR on the js-sdk fix (its rather annoying to not have the ringing stop) So my proposal would be to merge this without the lint rules and I keep the other PR's ontop of this so we can review and merge them independently? |
||
|
|
||
| import BasePlatform from "../src/BasePlatform"; | ||
| import Notifier from "../src/Notifier"; | ||
|
|
@@ -139,6 +143,11 @@ describe("Notifier", () => { | |
| getRoom: jest.fn(), | ||
| getPushActionsForEvent: jest.fn(), | ||
| supportsThreads: jest.fn().mockReturnValue(false), | ||
| matrixRTC: { | ||
| on: jest.fn(), | ||
| off: jest.fn(), | ||
| getRoomSession: jest.fn(), | ||
| }, | ||
| }); | ||
|
|
||
| mockClient.pushRules = { | ||
|
|
@@ -455,6 +464,35 @@ describe("Notifier", () => { | |
| expect(ToastStore.sharedInstance().addOrReplaceToast).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it("should not show toast when group call is already connected", () => { | ||
| setGroupCallsEnabled(true); | ||
| const spyCallMemberships = jest.spyOn(MatrixRTCSession, "callMembershipsForRoom").mockReturnValue([ | ||
| new CallMembership( | ||
| mkEvent({ | ||
| event: true, | ||
| room: testRoom.roomId, | ||
| user: userId, | ||
| type: EventType.GroupCallMemberPrefix, | ||
| content: {}, | ||
| }), | ||
| { | ||
| call_id: "123", | ||
| application: "m.call", | ||
| focus_active: { type: "livekit" }, | ||
| foci_preferred: [], | ||
| device_id: "DEVICE", | ||
| }, | ||
| ), | ||
| ]); | ||
|
|
||
| const roomSession = MatrixRTCSession.roomSessionForRoom(mockClient, testRoom); | ||
|
|
||
| mockClient.matrixRTC.getRoomSession.mockReturnValue(roomSession); | ||
| emitCallNotifyEvent(); | ||
| expect(ToastStore.sharedInstance().addOrReplaceToast).not.toHaveBeenCalled(); | ||
| spyCallMemberships.mockRestore(); | ||
| }); | ||
|
|
||
| it("should not show toast when calling with non-group call event", () => { | ||
| setGroupCallsEnabled(true); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.