* Update src with globalThis
* Update spec with globalThis
* Replace in more spec/ places
* More changes to src/
* Add a linter rule for global
* Prettify
* lint
* Update dependency typescript to v5.6.2
* Fix TS errors
* Update minimal version of TS to `5.4.2` since the code is not compliant with an older version.
* Review fixes
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
Co-authored-by: Florian Duros <florianduros@element.io>
* Add hacky option to disable the actual calling part of group calls.
So we can try using livekit instead.
* Put LiveKit info into the `m.call` state event (#3522)
* Put LK info into state
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Update to the new way the LK service works
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
---------
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Send 'contentLoaded' event
As per comment, so we can start digging ourselves out of the widget
API hole we're currently in.
* Add comment on updating the livekit service URL
* Appease CI on `livekit` branch (#3566)
* Update codeowners on `livekit` branch (#3567)
* add getOpenIdToken to embedded client backend
Signed-off-by: Timo K <toger5@hotmail.de>
* add test and update comment
Signed-off-by: Timo K <toger5@hotmail.de>
* Merge `develop` into `livekit` (#3569)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: RiotRobot <releases@riot.im>
Co-authored-by: Florian Duros <florianduros@element.io>
Co-authored-by: Kerry <kerrya@element.io>
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
Co-authored-by: Erik Johnston <erik@matrix.org>
Co-authored-by: Valere <bill.carson@valrsoft.com>
Co-authored-by: Hubert Chathi <hubertc@matrix.org>
Close IDB database before deleting it to prevent spurious unexpected close errors (#3478)
Fix export type `GeneratedSecretStorageKey` (#3479)
Fix order of things in `crypto-api.ts` (#3491)
Fix bug where switching media caused media in subsequent calls to fail (#3489)
fixes (#3515)
fix the integ tests, where #3509 etc fix the unit tests.
fix breakage on node 16 (#3527)
Fix an instance of failed to decrypt error when an in flight `/keys/query` fails. (#3486)
Fix `TypedEventEmitter::removeAllListeners(void)` not working (#3561)
* Revert "Merge `develop` into `livekit`" (#3572)
* Don't update calls with no livekit URL & expose method to update it instead
and generally simplify a bit: change it to a single string rather than
an array of structs.
* Fix other instances of passing focusInfo / livekit url
* Add temporary setter
* WIP refactor for removing m.call events
* Always remember rtcsessions since we need to only have one instance
* Fix tests
* Fix import loop
* Fix more cyclic imports & tests
* Test session joining
* Attempt to make tests happy
* Always leave calls in the tests to clean up
* comment + desperate attempt to work out what's failing
* More test debugging
* Okay, so these ones are fine?
* Stop more timers and hopefully have happy tests
* Test no rejoin
* Test malformed m.call.member events
* Test event emitting
and also move some code to a more sensible place in the file
* Test getActiveFoci()
* Test event emitting (and also fix it)
* Test membership updating & pruning on join
* Test getOldestMembership()
* Test member event renewal
* Don't start the rtc manager until the client has synced
Then we can initialise from the state once it's completed.
* Fix type
* Remove listeners added in constructor
* Stop the client here too
* Stop the client here also also
* ARGH. Disable tests to work out which one is causing the exception
* Disable everything
* Re-jig to avoid setting listeners in the constructor
and re-enable tests
* No need to rename this anymore
* argh, remove the right listener
* Is it this test???
* Re-enable some tests
* Try mocking getRooms to return something valid
* Re-enable other tests
* Give up trying to get the tests to work sensibly and deal with getRooms() returning nothing
* Oops, don't enable the ones that were skipped before
* One more try at the sensible way
* Didn't work, go back to the hack way.
* Log when we manage to send the member event update
* Support `getOpenIdToken()` in embedded mode (#3676)
* Call `sendContentLoaded()` (#3677)
* Start MatrixRTC in embedded mode (#3679)
* Reschedule the membership event check
* Bump widget api version
* Add mock for sendContentLoaded()
* More log detail
* Fix tests
and also better assert because the tests were passing undefined which
was considered fine because we were only checking for null.
* Simplify updateCallMembershipEvent a bit
* Split up updateCallMembershipEvent some more
* Typo
Co-authored-by: Daniel Abramov <inetcrack2@gmail.com>
* Expand comment
* Add comment
* More comments
* Better comment
* Sesson
* Rename some variables
* Comment
* Remove unused method
* Wrap updatecallMembershipEvent so it only runs one at a time
* Do another update if another one is triggered while the update happens
* Make triggerCallMembershipEventUpdate async
* Fix test & some missed timer removals
* Mark session manager as unstable
---------
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Timo K <toger5@hotmail.de>
Co-authored-by: Šimon Brandner <simon.bra.ag@gmail.com>
Co-authored-by: Timo K <toger5@hotmail.de>
Co-authored-by: Timo <16718859+toger5@users.noreply.github.com>
Co-authored-by: Daniel Abramov <inetcrack2@gmail.com>
* send expected peer connections to posthog.
(based on roomState event)
* add tests
* change GroupCallStats initialized
* prettier
* more test and catch for promise
* seperate the participant logic in a summary extend function
Signed-off-by: Timo K <toger5@hotmail.de>
* remove unused
Signed-off-by: Timo K <toger5@hotmail.de>
* rename summaryStatsReportGatherer to "Reporter"
for the summary stats there is only one instance because there is only
one summary. Since we dont have a list of gatherers it this class only reports.
Hence we rename it to be a reporter.
Signed-off-by: Timo K <toger5@hotmail.de>
* review
Signed-off-by: Timo K <toger5@hotmail.de>
* Update src/webrtc/stats/groupCallStats.ts
Co-authored-by: Robin <robin@robin.town>
* revert rename
Signed-off-by: Timo K <toger5@hotmail.de>
* Update all non-major dependencies (#3433)
* Update all non-major dependencies
* Remove name wrap-ansi-cjs
* Remove name string-width-cjs
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Update definitelyTyped (#3430)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Export FALLBACK_ICE_SERVER (#3429)
* Add an integration test for verification (#3436)
* Move existing crypto integ tests into a subdirectory
* Factor out some common bits from `crypto.spec.ts`
* Integration test for device verification
* Ignore generated file in prettier
* Always show a summary after Jest tests (#3440)
... because it is otherwise impossible to see what failed.
* Use correct /v3 prefix for /refresh (#3016)
* Add tests to ensure /v3/refresh is called + automatic /v1 retry
* Request /refresh with v3 prefix, and quietly fall back to v1
* Add tests checking re-raising errors
* Update spec/unit/login.spec.ts
* Update comment
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Update Mutual Rooms (MSC2666) support (#3381)
* update mutual rooms support
* clarify docs and switch eslint comment with todo
* please the holy linter
* change query variable names around
* add mock tests and fix issue
* ye holy linter
* GHA: build and cypress-test a copy of element-web after each push (#3412)
* Build a copy of element-web after each push
* Run cypress after each build of element-web
* Fix downstream-artifacts build (#3443)
* Fix downstream-artifacts build
* Update cypress.yml
* Fix edge cases around 2nd order relations and threads (#3437)
* Fix tests oversimplifying threads fixtures
* Check for unsigned thread_id in MatrixEvent::threadRootId
* Fix threads order being racy
* Make Sonar happier
* Iterate
* Make sliding sync linearize processing of sync requests (#3442)
* Make sliding sync linearize processing of sync requests
* Iterate
* Iterate
* Iterate
* Iterate
* Disable downstream artifacts build for develop branch (#3444)
* Export thread-related types from SDK (#3447)
* Export thread-related types from SDK
* address PR feedback
* Integration test for QR code verification (#3439)
* Integration test for QR code verification
Followup to https://github.com/matrix-org/matrix-js-sdk/pull/3436: another
integration test, this time using the QR code flow
* Use Object.defineProperty, and restore afterwards
Apparently global.crypto exists in some environments
* apply ts-ignore
* remove stray comment
* Update spec/integ/crypto/verification.spec.ts
* Add `getShowSasCallbacks`, `getShowQrCodeCallbacks` to VerifierBase (#3422)
* Add `getShowSasCallbacks`, `getShowQrCodeCallbacks` to VerifierBase
... to avoid some type-casting
* Integration test for QR code verification
Followup to https://github.com/matrix-org/matrix-js-sdk/pull/3436: another
integration test, this time using the QR code flow
* Rename method
... it turns out not to be used quite as I thought.
* tests for new methods
* Use Object.defineProperty, and restore afterwards
Apparently global.crypto exists in some environments
* apply ts-ignore
* More test coverage
* fix bad merge
* Fix changelog_head.py script to be Python 3 compatible
* Prepare changelog for v25.2.0-rc.1
* v25.2.0-rc.1
* Fix tsconfig-build.json
* Prepare changelog for v25.2.0-rc.2
* v25.2.0-rc.2
* Fix docs deployment
* Prepare changelog for v25.2.0-rc.3
* v25.2.0-rc.3
* Prepare changelog for v25.2.0-rc.4
* v25.2.0-rc.4
* [Backport staging] Attempt a potential workaround for stuck notifs (#3387)
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
* Prepare changelog for v25.2.0-rc.5
* v25.2.0-rc.5
* [Backport staging] Fix mark as unread button (#3401)
Co-authored-by: Michael Weimann <michaelw@matrix.org>
* Prepare changelog for v26.0.0-rc.1
* v26.0.0-rc.1
* Prepare changelog for v26.0.0
* v26.0.0
* Resetting package fields for development
* use cli.canSupport to determine intentional mentions support (#3445)
* use cli.canSupport to determine intentional mentions support
* more specific comment
* Update src/client.ts
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* git fixup
Signed-off-by: Timo K <toger5@hotmail.de>
* import updates
Signed-off-by: Timo K <toger5@hotmail.de>
* dont revert enricos change
Signed-off-by: Timo K <toger5@hotmail.de>
* temp rename for lowercase
* lowercase
---------
Signed-off-by: Timo K <toger5@hotmail.de>
Co-authored-by: Robin <robin@robin.town>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: David Lee <david@david-lee.net>
Co-authored-by: Jonathan de Jong <jonathan@automatia.nl>
Co-authored-by: Stanislav Demydiuk <stas-demydiuk@users.noreply.github.com>
Co-authored-by: ElementRobot <releases@riot.im>
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
Co-authored-by: Michael Weimann <michaelw@matrix.org>
Co-authored-by: Kerry <kerrya@element.io>
* Do an ice restart if ICE disconnected
- Waite two seconds after disconnected
- Remove check for finish ICE gathering and try to add each local candidate. Avoid race in multible ICE gathering
* Add tests for failed iceConnectionState
* suppress type check in unit test
* fix pr issues
* Refactor how group call end calls
We previously used disposeCall to terminate the call which meant that
sometimes a call would never get a hangup event. This changes it so
that we always end a call by calling hangup, then do the cleanup
when the hangup event arrives, so the cleanup is the same whether
we hang up or the other side does.
* Some fixes for failing & hanging tests
* Add type for the call map
This refactoring brings a number of improvements to GroupCall, which I've unfortunately had to combine into a single commit due to coupling:
- Moves the expiration timestamp field on call membership state to be per-device
- Makes the participants of a group call visible without having to enter the call yourself
- Enables users to join group calls from multiple devices
- Identifies active speakers by their call feed, rather than just their user ID
- Plays nicely with clients that can be in multiple calls in a room at once
- Fixes a memory leak caused by the call retry loop never stopping
- Changes GroupCall to update its state synchronously, and write back to room state asynchronously
- This was already sort of halfway being done, but now we'd be committing to it
- Generally improves the robustness of the state machine
- It means that group call joins will appear instant, in a sense
For many reasons, this is a breaking change.
* Fix screenshare failing after several attempts
Re-use any existing transceivers when screen sharing. This prevents
transceivers accumulating and making the SDP too big: see linked bug.
This also switches from `addTrack()` to `addTransceiver ()` which is
not that large of a change, other than having to explicitly find the
transceivers after an offer has arrived rather than just adding tracks
and letting WebRTC take care of it.
Fixes https://github.com/vector-im/element-call/issues/625
* Fix tests
* Unused import
* Use a map instead of an array
* Add comment
* more comment
* Remove commented code
* Remove unintentional debugging
* Add test for screenshare transceiver re-use
* Type alias for transceiver map
* 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>