* Remove deprecated calls in `webrtc/call.ts`
* Throw error when legacy call was used
* Remove `MatrixClient.initLegacyCrypto` (#4620)
* Remove `MatrixClient.initLegacyCrypto`
* Remove `MatrixClient.initLegacyCrypto` in README.md
* Remove tests using `MatrixClient.initLegacyCrypto`
* Remove legacy crypto support in `sync` api (#4622)
* Remove deprecated `DeviceInfo` in `webrtc/call.ts` (#4654)
* chore(legacy call): Remove `DeviceInfo` usage
* refactor(legacy call): throw `GroupCallUnknownDeviceError` at the end of `initOpponentCrypto`
* Remove deprecated methods and attributes of `MatrixClient` (#4659)
* feat(legacy crypto)!: remove deprecated methods of `MatrixClient`
* test(legacy crypto): update existing tests to not use legacy crypto
- `Embedded.spec.ts`: casting since `encryptAndSendToDevices` is removed from `MatrixClient`.
- `room.spec.ts`: remove deprecated usage of `MatrixClient.crypto`
- `matrix-client.spec.ts` & `matrix-client-methods.spec.ts`: remove calls of deprecated methods of `MatrixClient`
* test(legacy crypto): remove test files using `MatrixClient` deprecated methods
* test(legacy crypto): update existing integ tests to run successfully
* feat(legacy crypto!): remove `ICreateClientOpts.deviceToImport`.
`ICreateClientOpts.deviceToImport` was used in the legacy cryto. The rust crypto doesn't support to import devices in this way.
* feat(legacy crypto!): remove `{get,set}GlobalErrorOnUnknownDevices`
`globalErrorOnUnknownDevices` is not used in the rust-crypto. The API is marked as unstable, we can remove it.
* Remove usage of legacy crypto in `event.ts` (#4666)
* feat(legacy crypto!): remove legacy crypto usage in `event.ts`
* test(legacy crypto): update event.spec.ts to not use legacy crypto types
* Remove legacy crypto export in `matrix.ts` (#4667)
* feat(legacy crypto!): remove legacy crypto export in `matrix.ts`
* test(legacy crypto): update `megolm-backup.spec.ts` to import directly `CryptoApi`
* Remove usage of legacy crypto in integ tests (#4669)
* Clean up legacy stores (#4663)
* feat(legacy crypto!): keep legacy methods used in lib olm migration
The rust cryto needs these legacy stores in order to do the migration from the legacy crypto to the rust crypto. We keep the following methods of the stores:
- Used in `libolm_migration.ts`.
- Needed in the legacy store tests.
- Needed in the rust crypto test migration.
* feat(legacy crypto): extract legacy crypto types in legacy stores
In order to be able to delete the legacy crypto, these stores shouldn't rely on the legacy crypto. We need to extract the used types.
* feat(crypto store): remove `CryptoStore` functions used only by tests
* test(crypto store): use legacy `MemoryStore` type
* Remove deprecated methods of `CryptoBackend` (#4671)
* feat(CryptoBackend)!: remove deprecated methods
* feat(rust-crypto)!: remove deprecated methods of `CryptoBackend`
* test(rust-crypto): remove tests of deprecated methods of `CryptoBackend`
* Remove usage of legacy crypto in `embedded.ts` (#4668)
The interface of `encryptAndSendToDevices` changes because `DeviceInfo` is from the legacy crypto. In fact `encryptAndSendToDevices` only need pairs of userId and deviceId.
* Remove legacy crypto files (#4672)
* fix(legacy store): fix legacy store typing
In https://github.com/matrix-org/matrix-js-sdk/pull/4663, the storeXXX methods were removed of the CryptoStore interface but they are used internally by IndexedDBCryptoStore.
* feat(legacy crypto)!: remove content of `crypto/*` except legacy stores
* test(legacy crypto): remove `spec/unit/crypto/*` except legacy store tests
* refactor: remove unused types
* doc: fix broken link
* doc: remove link tag when typedoc is unable to find the CryptoApi
* Clean up integ test after legacy crypto removal (#4682)
* test(crypto): remove `newBackendOnly` test closure
* test(crypto): fix duplicate test name
* test(crypto): remove `oldBackendOnly` test closure
* test(crypto): remove `rust-sdk` comparison
* test(crypto): remove iteration on `CRYPTO_BACKEND`
* test(crypto): remove old legacy comments and tests
* test(crypto): fix documentations and removed unused expect
* Restore broken link to `CryptoApi` (#4692)
* chore: fix linting and formatting due to merge
* Remove unused crypto type and missing doc (#4696)
* chore(crypto): remove unused types
* doc(crypto): add missing link
* test(call): add test when crypto is enabled
* WIP support for state_after
* Fix sliding sync sdk / embedded tests
* Allow both state & state_after to be undefined
Since it must have allowed state to be undefined previously: the test
had it as such.
* Fix limited sync handling
* Need to use state_after being undefined
if state can be undefined anyway
* Make sliding sync sdk tests pass
* Remove deprecated interfaces & backwards-compat code
* Remove useless assignment
* Use updates unstable prefix
* Clarify docs
* Remove additional semi-backwards compatible overload
* Update unstable prefixes
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix test
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Add test for MSC4222 behaviour
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve coverage
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Tidy
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Add comments to explain why things work as they are.
* Fix sync accumulator for state_after sync handling
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Add tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Revert "Fix room state being updated with old (now overwritten) state and emitting for those updates. (#4242)"
This reverts commit 957329b21821c0f632de6c04fff53144f7c0e5dd.
* Fix Sync Accumulator toJSON putting start timeline state in state_after field
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Add test case
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Hugh Nimmo-Smith <hughns@matrix.org>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Timo <toger5@hotmail.de>
* 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 all non-major dependencies
* Prettier
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix types for widget API update
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Introduce Membership TS type
* Adapt the Membership TS type to be an enum
* Add docstrings for KnownMembership and Membership
* Move Membership types into a separate file, exported from types.ts
---------
Co-authored-by: Stanislav Demydiuk <s.demydiuk@gmail.com>
* 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>
* Refactor names in webrtc stats
* Refactor summary stats reporter to gatherer
* Add call and opponent member id to call stats reports
* Update opponent member when we know them
* Add missing return type
* remove async in test
* add call feed webrtc report
* add logger for error case in stats gathering
* gather connection track report
* expand call feed stats with call feed
* formation code and fix lint issues
* clean up new track stats
* set label for call feed stats and
* remove stream in track stats
* transceiver stats based on mid
* call feed stats based on stream id
* fix lint and test issues
* Fix merge issues
* Add test for expanding call feed stats in group call
* Fix export issue from prv PR
* explain test data and fixed some linter issues
* convert tests to snapshot tests
* 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>
* Refactor names in webrtc stats
* Refactor summary stats reporter to gatherer
* Add call and opponent member id to call stats reports
* Update opponent member when we know them
* Add missing return type
* remove async in test
* mark new stats property as optional to avoid braking changes
* check permission only if no audio track
* fix linter issues
* add missing tests for perfect negotiation pattern
* add null case in unit tests for audio muting
* fix issue with type MediaStream
* force right type of mock methode
* format code
* add audio concealment to stats report
* audio concealment to summary
* make ts linter happy
* format and rename
* fix and add tests
* make it prettier!
* we can make it even prettier ?!
* review
* fix tests
* pretty
* one empty line to ...
* remove ratio in audio concealment (ratio is now done in the summary)
* remove comment
* fix test
* add peer connections to summary report
* tests
* add audio concealment to stats report
* audio concealment to summary
* make ts linter happy
* format and rename
* fix and add tests
* make it prettier!
* we can make it even prettier ?!
* review
* fix tests
* pretty
* one empty line to ...
* remove ratio in audio concealment (ratio is now done in the summary)
* remove comment
* fix test
* 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
* stats: disable stats collection if interval zero
* stats: add groupcall property for stats interval
* stats: disable collecting webrtc stats by default
* add setup methode for group call stats
* suppress lint errors in test
* Fix lack of media when a user reconnects
This fixes broken media when someone reconnects to the call after
a forced disconnect (when their old call gets replaced immediately
by a new call). We listen for changes in the call feeds and the tearing
down of the feeds for the old call caused us to remove the feed for
the new call.
Also adds the call to the calls map before it'as initialised, such that
it's the active call for the user/device when the feedsChanged event arrives,
otherwise we'll ignore the event.
* Fix tests
* stats: calculate received media by ignore not added tracks
* stats: fix lint issue
---------
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
* stats: add max jitter and max packet loss
* stats: add test for max jitter and packet loss
* stats: add build summery report tests
* stats: switch to packetsLost instead of packetsTotal
* stats: Add Jitter stats
* Update src/webrtc/stats/trackStatsReporter.ts
Co-authored-by: Robin <robin@robin.town>
* stats: Fix typos in tests
* stats: differences between 0 and undefined in jitter val
---------
Co-authored-by: Robin <robin@robin.town>
* stats: add summery stats reporter
* stats: export summery stats reports
* stats: fix typo of event name
* stats: check promise condition for node 16 test linter
* stats: remove weak test to figure out memory leak
* stats: remove second weak test
* stats: add starting processing test
* stats: fix tests
* stats: fix typo in group call
* stats: fix stats report gathering test
* stats: reactivate promise merge
* stats: add track counter and track mute counter in summary stats
* stats: add summery calculation
* stats: fix PR issues
* stats: adjust summery reporter for inbound and mute state
* stats: check async state
* stats: switch from an `Or` to `And` condition for entire received media value
* stats: Add property description
---------
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
* 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
As explained in the comment. I've added it to the end so this should
be completely backwards compatible (although it would be much nicer
if it were the first arg, probably).
* groupCall: add configuration param to allow no audio and no camera
* groupCall: enable datachannel to do no media group calls
* groupCall: changed call no media property as object property
* groupCall: fix existing unit tests
* groupCall: remove not needed flag
* groupCall: rename property to allow no media calls
* groupCall: mute unmute even without device
* groupCall: switch to promise callbacks
* groupCall: switch to try catch
* test: filter dummy code from coverage
* test: extend media mute tests
* groupCall: move permission check to device handler
* mediaHandler: add error in log statement