* Add `getUserDeviceInfo` to `CryptoBackend` and old crypto impl
* Add `getUserDeviceInfo` WIP impl to `rust-crypto`
* Add tests for `downloadUncached`
* WIP test
* Fix typo and use `downloadDeviceToJsDevice`
* Add `getUserDeviceInfo` to `client.ts`
* Use new `Device` class instead of `IDevice`
* Add tests for `device-convertor`
* Add method description for `isInRustUserIds` in `rust-crypto.ts`
* Misc
* Fix typo
* Fix `rustDeviceToJsDevice`
* Fix comments and new one
* Review of `device.ts`
* Remove `getUserDeviceInfo` from `client.ts`
* Review of `getUserDeviceInfo` in `rust-crypto.ts`
* Fix typo in `index.ts`
* Review `device-converter.ts`
* Add documentation to `getUserDeviceInfo` in `crypto-api.ts`
* Last changes in comments
* stats: calculate received media by ignore not added tracks
* stats: fix lint issue
---------
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
* Element-R: implement `{get,set}TrustCrossSignedDevices`
A precursor to https://github.com/vector-im/element-web/issues/25092
* Pull out new `DeviceVerificationStatus`
Define a new base class to replace `DeviceTrustLevel`. The intention is to have
a cleaner interface which is easier to expose from the new crypto impl
* Define, and implement, a new `CryptoApi.getDeviceVerificationStatus`
This is similar to `checkDeviceTrust`, which we're deprecating, but:
* is `async`, meaning we can implement it in Rust
* Returns a `DeviceVerificationStatus` instead of a `DeviceTrustLevel`
* Returns `null` rather than "not verified" if the device is unknown
* add some tests
* Export DeviceVerificationStatus as a proper class
... so that we can instantiate it in tests
* 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>
* Pull `SecretStorageCallbacks` out of `ICryptoCallbacks`
* Pull the storage part of SecretStorage out to a new class
* Move SecretSharing to a separate class
* Move `ISecretRequest` into `SecretSharing.ts`
* Pull out ISecretStorage interface, and use it
* Mark old `SecretStorage` as deprecated, and rename accesses to it
* Move a `SecretStorage` unit test into its own file
* Use new `SecretStorage` in a couple of places
* add some more unit tests
* Fix test file name
... to match the unit under test
* even more tests
* Add a load of comments
* Rename classes
* Fix some broken tsdoc links
* fix broken test
* Fix compaints about superlinear regex
* just one more test
* Retry processing potential poll events after decryption
* Point `typedoc` at `matrix.ts`, not `index.ts` (#3239)
This gets rid of the rather pointless "default" module in the generated docs.
* Split up, rename, and move `ISecretStorageKeyInfo` (#3242)
* Move SecretStorageKeyInfo interfaces out to a new module
* Replace usages of ISecretStorageKeyInfo with SecretStorageKeyDescription
* Skip clear text non-poll events
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* 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>
* Remove redundant `IAccountDataClient.getAccountData`
This is never called, so we may as well get rid of it
* Move a few more interfaces into `secret-storage.ts`
* Use interfaces from `secret-storage`
* Move IAccountDataClient to secret-storage
* Use `AccountDataClient` from `secret-storage`
* move SECRET_STORAGE_ALGORITHM_V1_AES to secret-storage
* Use `SECRET_STORAGE_ALGORITHM_V1_AES` from `secret-storage`
* Add a test case for the quality gate
* Update src/secret-storage.ts
* 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).
* Send one time key count and unused fallback keys for rust-crypto
* Add tests
* Remove useless type in promise return
* Add test for one time key upload
* Fix rust-crypto.spec.ts tests
* Remove unneeded code in test
* Add key upload request test
* Fix tests
* Refactor the room key handling method
* Fix the forwarded room key test to use the same user ids.
We have some tests that check if receiving a forwarded room key works.
These claim to use the same user id, but in fact they change the user id
in the last moment before the event is passed into the client.
Let's change this so we're always operating with the same user id.
* Stop requesting room keys from other users
We never accept such room keys, so there isn't a point in requesting
them.
* fixup! Refactor the room key handling method
* Apply suggestions from code review
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* fixup! Refactor the room key handling method
* fixup! Apply suggestions from code review
* fixup! Refactor the room key handling method
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* 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
* v2 of MSC3903 implementation
This is a deliberate breaking change on an unstable feature.
* Reinstate v1 support to make this a non-breaking change
Deprecates several experimental types
* Remove MSC3903 v1 support
This is a breaking change in code marked unstable/experimental
Revert "Reinstate v1 support to make this a non-breaking change"
This reverts commit 89773458b9.
* v2 of MSC3903 implementation
This is a deliberate breaking change on an unstable feature.
* Test correct protocol version
* Fix up test
* v2 of MSC3903 implementation
This is a deliberate breaking change on an unstable feature.
* Test correct protocol version
* Fix up test
* Reinstate v1 support to make this a non-breaking change
Deprecates several experimental types