* Store cross signing keys in secret storage
* Update `bootstrapSecretStorage` doc
* Throw error when `createSecretStorageKey` is not set
* Move mocking functions
* Store cross signing keys and user signing keys
* Fix `awaitCrossSigningKeyUpload` documentation
* Remove useless comment
* Fix formatting after merge conflict
* 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>
* 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
* 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
* Fix an existing test for editing messages in threads
While attempting to test a new change, I discovered that the test
"should allow edits to be added to thread timeline" did not actually
fail if its assertions failed. Further, those assertions were incorrect.
So this change fixes the test to create the thread, wait for it to be
initialised, and then add events to it. This simplifies the flow and
ensures the test fails if something unexpected happens.
* Move editing test into thread.spec.ts
* Isolate Thread global modification in beforeAll()
* Delete unneeded setUnsigned call
* Use standard message-creation methods
* Rename event variables
* Rename sender->user
* Remove unneeded variables
* Extract distractions into functions
* Fix mark as unread button
* Revert to prefer the last event from the main timeline
* Refactor room test
* Fix type
* Improve docs
* Insert events to the end of the timeline
* Improve test doc
* 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
* minor cleanups to the crypto tests
mostly, this is about using `testUtils.awaitDecryption` rather than custom
code. Some other cleanups too.
* Keep a record of events which are missing their keys
* Retry event decryption when we receive megolm keys
* 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
I became sufficiently annoyed with matrix-mock-request that I decided to replace it with fetch-mock, which is what we use in matrix-react-sdk and is generally more powerful, easier to use, and actually maintained.
Unfortunately, we have a TestClient utility which is widely used and quite tightly integrated with matrix-mock-request. It wasn't going to be possible to change TestClient without changing all the tests that use it.
I also don't find TestClient particularly easy to use - it does a lot of stuff which I'm not convinced ought to be done for every single test.
So... I've introduced a couple of new classes (SyncResponder, E2EKeyReceiver) which do some of the useful bits of TestClient, but in a more granular way, and have switched crypto.spec.ts over so that rather than instantiating a TestClient for each test, it creates a MatrixClient directly and intercepts the endpoints necessary.
* first cut poll model
* process incoming poll relations
* allow alt event types in relations model
* allow alt event types in relations model
* remove unneccesary checks on remove relation
* comment
* Revert "allow alt event types in relations model"
This reverts commit e578d84464.
* Revert "Revert "allow alt event types in relations model""
This reverts commit 515db7a8bc.
* basic handling for new poll relations
* tests
* test room.processPollEvents
* join processBeaconEvents and poll events in client
* tidy and set 23 copyrights
* use rooms instance of matrixClient
* tidy
* more copyright
* simplify processPollEvent code
* throw when poll start event has no roomId
* updates for events-sdk move
* more type changes for events-sdk changes
* validate poll end event senders
* reformatted copyright
* undo more comment reformatting
* fix poll end validation logic to allow poll creator to end poll regardless of redaction
* Update src/models/poll.ts
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* correct creator == sender validationin poll end
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Fix issue where the root event of a thread had to be loaded in a complicated way
* Fix issue where edits to the last event of a thread would get lost
* Fix issue where thread reply count would desync
* Refactor relations pagination mocking for tests
vector-im/element-web#23819 is an intermittent failure to correctly initiate a user verification process. The
root cause is as follows:
* In matrix-react-sdk, ensureDMExists tries to create an encrypted DM room, and assumes it is ready for use
(including sending encrypted events) as soon as it receives a RoomStateEvent.NewMember notification
indicating that the other user has been invited or joined.
* However, in sync.ts, we process the membership events in a /sync response (including emitting
RoomStateEvent.NewMember notifications), which is long before we process any m.room.encryption event.
* The upshot is that we can end up trying to send an encrypted event in the new room before processing
the m.room.encryption event, which causes the crypto layer to blow up with an error of "Room was
previously configured to use encryption, but is no longer".
Strictly speaking, ensureDMExists probably ought to be listening for ClientEvent.Room as well as RoomStateEvent.NewMember; but that doesn't help us, because ClientEvent.Room is also emitted
before we process the crypto event.
So, we need to process the crypto event before we start emitting these other events; but a corollary of that
is that we need to do so before we store the new room in the client's store. That makes things tricky, because
currently the crypto layer expects the room to have been stored in the client first.
So... we have to rearrange everything to pass the newly-created Room object into the crypto layer, rather than
just the room id, so that it doesn't need to rely on getting the Room from the client's store.
* Update tests
* Call `Store.storeRoom` earlier
We're going to call `onCryptoEvent` earlier in `processSyncResponse`, but we
need to have stored the room before doing so. We therefore need to move the
call to `storeRoom` earlier.
We can actually reduce a bit of duplication by moving the call into
`SyncApi.createRoom`.
`storeRoom` has relatively few side-effects, so as far as I can tell this
should be pretty safe.
* Call onCryptoEvent before processing state events
This fixes the problematic race condition.
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