* MediaHandler Tests, part 1
Haven't got through all the methods yet
For https://github.com/vector-im/element-call/issues/544
* Didn't need these in the end
* Rest of the media handler tests
* getUserMediaStream takes args
* use mockResolvedValue
* Add .off & reuse the mock we already made
* Re-use mock handler again
* Move updateLocalUsermediaStream to beforeEach
* add .off
* Add types
* Add more .offs
* Base support for MSC3847: Ignore invites with policy rooms
Type: enhancement
* Base support for MSC3847: Ignore invites with policy rooms
Type: enhancement
* WIP: Applying feedback
* WIP: Applying feedback
* WIP: CI linter gives me different errors, weird
* WIP: A little more linting
* utils: Fix bug in deepCompare which would incorrectly return objects with disjoint keys as equal
* Fix bugs in sync test
This test wrongly asserted that `initialSyncLimit` would be used to make a filter
It is used only for the initial sync inline filter, and not in POST /filter
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Add types to the call unit test suites
Still involves quite a few casts to any unfortunately as it turns
out we access quite a few private methods on the Call class in these
tests.
* Remove commented line & use better expect syntax
* Replace more calls.length with toHaveBeenCalled
* Remove mistakenly added id field
* 1:1 screenshare tests
Fixes https://github.com/vector-im/element-call/issues/548
* Always hang up calls after tests
to prevent hanging tests
Also fix a null dereference as we may not have an invitee or opponent
member when sending voip events if not using to-device messages.
* use mockImplementationOnce
Co-authored-by: Robin <robin@robin.town>
* use mockImplementationOnce
Co-authored-by: Robin <robin@robin.town>
* Add type on mock
* Add corresponding call.off
* Merge enable & disable screenshare tests
Co-authored-by: Robin <robin@robin.town>
* Add tests for incoming calls in group calls
Inspiration wwlecome for the renamed describe group which we're
really abusing for a bunch of things that happen to have the same
dependencies.
Fixes https://github.com/vector-im/element-call/issues/532
* Extract incoming call tests out into their own describe
and get the lexicographical ordering to match who should be calling who
* Trailing space
* Test placing a call in a group call
Refactors a bit of the call testing stuff
Fixes https://github.com/vector-im/element-call/issues/521
* Unused imports
* Use expect.toHaveBeenCalledWith()
* Types
* More types
* Add comment on mock typing
* Use toHaveBeenCalledWith()
* Initialise groupcall & room in beforeEach
* Initialise mockMediahandler sensibly
* Add type params to mock
* Rename mute tests
* Move comment
* Join / leave in parallel
* Remove leftover expect
* WIP RoomWidgetClient
* Wait for the widget API to become ready before backfilling
* Add support for sending user-defined encrypted to-device messages
This is a port of the same change from the robertlong/group-call branch.
* Fix tests
* Emit an event when the client receives TURN servers
* Expose the method in MatrixClient
* Override the encryptAndSendToDevices method
* Add support for TURN servers in embedded mode and make calls mostly work
* Don't put unclonable objects into VoIP events
RoomWidget clients were unable to send m.call.candidate events, because
the candidate objects were not clonable for use with postMessage.
Converting such objects to their canonical JSON form before attempting
to send them over the wire solves this.
* Fix types
* Fix more types
* Fix lint
* Upgrade matrix-widget-api
* Save lockfile
* Untangle dependencies to fix tests
* Add some preliminary tests
* Fix tests
* Fix indirect export
* Add more tests
* Resolve TODOs
* Add queueToDevice to RoomWidgetClient
* Add basic creation / entering tests for group calls
* Missing space
Co-authored-by: Robin <robin@robin.town>
* Assert more of the group call member event
and also move call leaving to a finally so it doesn't leaving a call
hagning if it fails.
Co-authored-by: Robin <robin@robin.town>
This will be rolled out again later with more accompanying UI adjustments, including clearer error messages and possibly the option to disable it per-room.
* Prepare changelog for v19.2.0-rc.1
* v19.2.0-rc.1
* Sliding sync: add missing filters from latest MSC
* Gracefully handle missing room_ids
* Prepare changelog for v19.2.0
* v19.2.0
* Resetting package fields for development
* Use EventType enum values instead of hardcoded strings (#2557)
* Retry to-device messages (#2549)
* Retry to-device messages
This adds a queueToDevice API alongside sendToDevice which is a
much higher-level API that adds the messages to a queue, stored in
persistent storage, and retries them periodically. Also converts
sending of megolm keys to use the new API.
Other uses of sendToDevice are nopt converted in this PR, but could
be later.
Requires https://github.com/matrix-org/matrix-mock-request/pull/17
* Bump matrix-mock-request
* Add more waits to make indexeddb tests pass
* Switch some test expectations to queueToDevice
* Stop straight away if the client has been stopped
Hopefully will fix tests being flakey and logging after tests have
finished.
* Add return types & fix constant usage
* Fix return type
Co-authored-by: Germain <germains@element.io>
* Fix return type
Co-authored-by: Germain <germains@element.io>
* Fix return type
Co-authored-by: Germain <germains@element.io>
* Stop the client in all test cases
Co-authored-by: Germain <germains@element.io>
* Add support for sending user-defined encrypted to-device messages (#2528)
* Add support for sending user-defined encrypted to-device messages
This is a port of the same change from the robertlong/group-call branch.
* Fix tests
* Expose the method in MatrixClient
* Fix a code smell
* Fix types
* Test the MatrixClient method
* Fix some types in Crypto test suite
* Test the Crypto method
* Fix tests
* Upgrade matrix-mock-request
* Move useRealTimers to afterEach
* Remove stream-replacement (#2551)
* Reintroduce setNewStream method, fix test, update yarn.lock
Co-authored-by: RiotRobot <releases@riot.im>
Co-authored-by: Kegan Dougal <kegan@matrix.org>
Co-authored-by: Germain <germains@element.io>
Co-authored-by: Robin <robin@robin.town>
Co-authored-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Add support for sending user-defined encrypted to-device messages
This is a port of the same change from the robertlong/group-call branch.
* Fix tests
* Expose the method in MatrixClient
* Fix a code smell
* Fix types
* Test the MatrixClient method
* Fix some types in Crypto test suite
* Test the Crypto method
* Fix tests
* Upgrade matrix-mock-request
* Move useRealTimers to afterEach
* Retry to-device messages
This adds a queueToDevice API alongside sendToDevice which is a
much higher-level API that adds the messages to a queue, stored in
persistent storage, and retries them periodically. Also converts
sending of megolm keys to use the new API.
Other uses of sendToDevice are nopt converted in this PR, but could
be later.
Requires https://github.com/matrix-org/matrix-mock-request/pull/17
* Bump matrix-mock-request
* Add more waits to make indexeddb tests pass
* Switch some test expectations to queueToDevice
* Stop straight away if the client has been stopped
Hopefully will fix tests being flakey and logging after tests have
finished.
* Add return types & fix constant usage
* Fix return type
Co-authored-by: Germain <germains@element.io>
* Fix return type
Co-authored-by: Germain <germains@element.io>
* Fix return type
Co-authored-by: Germain <germains@element.io>
* Stop the client in all test cases
Co-authored-by: Germain <germains@element.io>