* 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
* 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>
* Small tidy-up to sync.ts
* Convert doSync into a while loop
* Apply `initialSyncLimit` only to initial syncs
* Convert matrix-client-syncing spec to TS
* Add tests around initial sync filtering
* Switch confusing filterId field for `filter`
* Tweak doSync error control flow
* Fix error control flow intricacies
* use includes
* Add tests
* Fix some strict mode errors
* Fix more strict mode errors
* Fix some strict mode errors
* 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
* 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>
* Send call version `1` as a string (#2471)
* test typescriptification - backup.spec (#2468)
* renamed: spec/unit/crypto/crypto-utils.js -> spec/unit/crypto/crypto-utils.ts
* ts fixes in crypto-utils
* renamed: spec/unit/crypto/backup.spec.js -> spec/unit/crypto/backup.spec.ts
* ts fixes in backup.spec
* remove fit
* remove debug
* Prepare changelog for v19.0.0-rc.1
* v19.0.0-rc.1
* Update jest monorepo (#2476)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Update all (#2475)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Update dependency @types/jest to v28 (#2478)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Fix call.collectCallStats() (#2480)
Regressed by https://github.com/matrix-org/matrix-js-sdk/pull/2352
(you can just use RTCStatsReport as an iterator directly (which
was was what that code was doing before) which uses entries(
which gives you key/value pairs, but using forEach gives you just
the value.
* Go back to forEach in collectcallstats (#2481)
Older typescript library doesn't know about .values() on the stats
object, so it was failing in react sdk which had an older typescript.
https://github.com/matrix-org/matrix-react-sdk/pull/8935 was an
attempt to upgrade it but did not seem to be helping on CI, despite
being fine locally.
* Update babel monorepo to v7.18.6 (#2477)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Expose KNOWN_SAFE_ROOM_VERSION (#2474)
* Fix return type on funcs in matrixClient to be optionally null (#2488)
* Update pull_request.yaml (#2490)
* Lock file maintenance (#2491)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Prepare changelog for v19.0.0
* v19.0.0
* Resetting package fields for development
* Improve VoIP integrations testing (#2495)
* Remove MSC3244 support (#2504)
* Actually store the identity server in the client when given as an option (#2503)
* Actually store the identity server in the client when given as an option
* Update requestRegisterEmailToken to a modern spec version too
* Properly re-insert room ID in bundled thread relation messages from sync (#2505)
Events returned by the `/sync` endpoint, including relations bundled with other events, may have their `room_id`s stripped out. This causes decryption errors if the IDs aren't repopulated.
Fixesvector-im/element-web#22094.
* Remove `setNow` from `realtime-callbacks.ts` (#2509)
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Remove dead code (#2510)
* Don't crash with undefined room in `processBeaconEvents()` (#2500)
* Add a basic PR checklist for all PRs (#2511)
It'll be mildly annoying for core developers who have to constantly remove or edit this, but it'll also serve as a good reminder to do these things.
Note that signoff is not required for core developers.
* Fix tests
Co-authored-by: Šimon Brandner <simon.bra.ag@gmail.com>
Co-authored-by: Kerry <kerrya@element.io>
Co-authored-by: RiotRobot <releases@riot.im>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Weimann <michaelw@matrix.org>
Co-authored-by: texuf <texuf.eth@gmail.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Travis Ralston <travisr@matrix.org>
Co-authored-by: Faye Duxovni <fayed@element.io>
Events returned by the `/sync` endpoint, including relations bundled with other events, may have their `room_id`s stripped out. This causes decryption errors if the IDs aren't repopulated.
Fixesvector-im/element-web#22094.
* Fix test message utils using overload
* Tweak existing tests
* Add test around `MatrixClient::getEventTimeline`
* Fix test to actually exercise the faulty behaviour
* Extract timelineSet thread belongs logic and test it
* tweak method name
* Update relations after every decryption attempt
If an event is encrypted the aggregation cannot pick up the relation types.
Before this change there was exactly one aggregation retry after decryption.
If the events are being decrypted afterwards (for example on restore
from key backup) the aggregation was not aware of that.
This change adds relation updates after every decryption event if there
has been a decryption error.
Signed-off-by: Michael Weimann <michaelw@matrix.org>
* use beacon info event type as beacon identifier
Signed-off-by: Kerry Archibald <kerrya@element.io>
* test cases
Signed-off-by: Kerry Archibald <kerrya@element.io>