* Skip unwritten tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Tidy jest fake timers
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove unnecessary sessionStorage mock
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve types
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve async assertions
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve error assertions
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve object assertions
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove assertion testing unclear mock
This test failed when ran individually, same as after the clearAllMocks call
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Avoid awaiting non-thenables
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Pass nop function when stubbing out console, vitest won't accept it any other way
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove unnecessary mock which causes tests to fail after updating fetch-mock & fix typo
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix mistaken assertions not testing all values in array
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix hidden non-running tests in room.spec.ts
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Use normal base64 encoding for RTC backend identities
MSC4195 has been updated to specify that normal (non-URL-safe) base64 is the correct encoding for LiveKit participant identities.
* Test RTC backend identity computation
* Update dependency @matrix-org/matrix-sdk-crypto-wasm to v17
* Remove references to `ShieldStateCode.SentInClear`
This was never used, and is no longer exported, by rust-sdk-crypto-wasm, so we
need to remove references to it.
* Add `MatrixEvent.getKeyForwardingUser`
Expose information about keys forwarded via MSC4286, via a new method on
`MatrixEvent`.
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Update dependency @matrix-org/matrix-sdk-crypto-wasm to v17
* Remove references to `ShieldStateCode.SentInClear`
This was never used, and is no longer exported, by rust-sdk-crypto-wasm, so we
need to remove references to it.
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <richard@matrix.org>
* cleanup: Remove deprecated API
* clean: breakdown method to reduce cognitive complexity
* cleanup: use readonly has never reassigned
* cleanup: Do not use an object literal as default
* quick format
* fixup: missed a param while refactoring
* cleanup: additional breakdown to reduce cognitive complexity
* review: better names
* Remove unused property MatrixEvent.untrusted
This was never set to anything other than `false`. I think it is a hangover
from pre-rust-sdk.
* Remove call to redundant `isKeySourceUntrusted`
`isKeySourceUntrusted` always returns false so no point calling it
* Remove dangling assignments to MatrixEvent.untrusted
* deprecate membershipID -> memberId & memberId -> stateKey in membership
manager
The membership manager used the memberId label for the stateKey. But
only the StickymembershipManager really has a configurable memberId.
* participantId -> callMembershipIdentityParts
The participantId is a termonology from livekit. We do not want it in
here! We want the js-sdk to be mostly transport agnostic. We do the
transition from the identity parts to the acutal livekit identity in
Element call (`sha256(userId+deviceId+memberId)`)
* update tests
* Expose `kind` to decide if we use the hashed or non hashed livekit
participants.
* expose delayId from the matrixRTCSession for delayed event delegation.
* rename if to mapKey
* backandId computation as part of the js-sdk
* review valere
* valr + timo keysWithoutMatchingRTCMembership
* fix legacy encryption manager
* fix doc issue
* fix doc
* fix imports
* Encryption Manager needs own rtcBackendIdentity to use
The encryption manager needs to signal our own key fast, cannot wait for remote echo of rtc membership. So it needs to be able to compute the rtcBackendIdentity
* fix test
* Remove double `useHashedRtcBackendIdentity` assignment. rename
variables.
* little improvements This stops the usage from the matrix event outside
the CallMemerbship constructor.
* fix logger import
* Add back deprecated API for compat
* Make change to CallMembership constructor backward compatible
* more backward compatible
---------
Co-authored-by: Valere <bill.carson@valrsoft.com>
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-9.html#libdts-changes
TypeScript 5.9 changes some things about the ArrayBuffer type and makes a number of DOM types, including the subtle crypto APIs, require a narrower buffer type as their input. For example if you wanted to use crypto.subtle.importKey to convert a MatrixRTC encryption key buffer given by matrix-js-sdk to a CryptoKey, you would run into a type error with TS 5.9. Specifying the type parameter of Uint8Array everywhere around the MatrixRTC files fixes this breakage.
* Make the enableEncryptedStateEvents property on MatrixClient public
* fixup! Make the enableEncryptedStateEvents property on MatrixClient public
tsdoc for enableEncryptedStateEvents
* fixup! Make the enableEncryptedStateEvents property on MatrixClient public
Improve the description of enableEncryptedStateEvents
* Make token refresher init itself lazily
It needs a network connection to do the init, so this would fail if
a client tried to do it at startup with no internet, causing the token
to just never be refreshed.
This just changes the API (compatibly) to do the init lazily.
The promise is kept is retain backwards compat, it can be removed
later.
* Make deviceId protected
* Fix tests
* feat: Import room key bundles when received after invite.
* tests: Add spec test for room key bundle arriving after invite accepted.
* chore: Fix code quality issue (unnecessary async function).
* docs: Tidy up comments.
* refactor: Simplify key bundle importing after invite to one entrypoint.
- Remove `onReceiveToDeviceEvent` from `CryptoBackend`.
- Copy old room key bundle importing logic to
`preprocessToDeviceEvents`.
* refactor: Move late bundle importing to main preprocess loop.
* fix: Use `Map` over `Record` to prevent prototype pollution.
* Avoid use of Optional type
As we are likely to remove dependency on matrix-events-sdk
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Tweak params
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Prettier
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update test
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>