* implement `VerificationRequest.pending`
* Implement `VerificationRequest.timeout`
* Rust crypto: allow using a memory store (#3536)
* Rust crypto: allow using a memory store
It turns out that, for some usecases (in particular, "bot users" for cypress
tests), we don't need persistent storage and an in-memory store will be fine.
* Rust crypto: use a memory store for the unit tests
* Pass `supportedVerificationMethods` into `VerificationRequest`
... so that the application can later call `accept()` and we know what to send.
* Implement `VerificationRequest.accept`
* Implement `VerificationRequest.declining`
* Update src/rust-crypto/verification.ts
* integ tests: factor out some utility methods
* Add `VerificationRequest.startVerification` to replace `beginKeyVerification`
The rust SDK ties together creating the verifier and sending the
`m.key.verification.start` message, so we need to combine
`.beginKeyVerification` and `.verify`.
* add some unit tests
* utils for authorization step in OIDC code grant
* tidy
* completeAuthorizationCodeGrant util functions
* response_mode=query
* add scope to bearertoken type
* add is_guest to whoami response type
* doc comments
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* use shimmed TextEncoder
* fetchMockJest -> fetchMock
* comment
* bearertokenresponse
* test for lowercase bearer
* handle lowercase token_type
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Return uploaded keys from `/keys/query`
* Basic implementation of SAS verification in Rust
* Update the `verifier` *before* emitting `erificationRequestEvent.Change`
* remove dead code
A couple of tests were waiting for a request that wasn't happening, so timing
out after 1.5 seconds. Let's avoid the extra slowth.
(This was introduced by changes in
https://github.com/matrix-org/matrix-js-sdk/pull/3487, but the changes in this
PR do no harm anyway)
* Element-R: wait for OlmMachine on startup
Previously, if you called `CryptoApi.getUserDeviceInfo()` before the first
`/sync` request happened, it would return an empty list, which made a bunch of
the tests racy. Add a hack to get the OlmMachine to think about its device
lists during startup.
* add a test
* validate m.authentication, fetch issuer wellknown
* move validation functions into separate file
* test validateWellKnownAuthentication
* test validateOIDCIssuerWellKnown
* add authentication cases to autodiscovery tests
* test invalid authentication config on wk
* improve types
* test case for account:false
* use hasOwnProperty in validateWellKnownAuthentication
* comments
* make registration_endpoint optional
* Add `crypto.getCrossSigningStatus`
* Fix imports and boolean casting
* Moved `isStoredInSecretStorage` into a single function
* Review changes `CrossSigningStatus`
* Review changes for `cross-signing.spec.ts`
* Add test in case when cross signing is not setup
* Handle when the `crossSigningStatus` returned by the olmMachine is null
* Review changes for `crypto-api` documentation
* Update `cross-signing.spec.ts` according to review changes
* Moved and renamed `isStoredInSecretStorage`
* Remove noise in `CrossSigning.ts` imports
* Fix `returns` sentence in `secretStorageContainsCrossSigningKeys`
* Fix typos
* Add test for `secret-storage.ts`
* Improve documentation
* Add doc about fetch mock request name
* 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>
* Fix tests oversimplifying threads fixtures
* Check for unsigned thread_id in MatrixEvent::threadRootId
* Fix threads order being racy
* Make Sonar happier
* Iterate
* 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
* 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>
* Do not assume that a relation lives in main timeline if we do not know its parent
* For pagination, partition relations with unknown parents into a separate bucket
And only add them to relation map, no timelines
* Make addLiveEvents async and have it fetch parent events of unknown relations to not insert into the wrong timeline
* Fix tests not awaiting addLIveEvents
* Fix handling of thread roots in eventShouldLiveIn
* Fix types
* Fix tests
* Fix import
* Stash thread ID of relations in unsigned to be stashed in sync accumulator
* Persist after processing
* Revert "Persist after processing"
This reverts commit 05ed6409b3.
* Update unsigned field name to match MSC4023
* Persist after processing to store thread id in unsigned sync accumulator
* Add test
* Fix replayEvents getting doubled up due to Thread::addEvents being called in createThread and separately
* Fix test
* Switch to using UnstableValue
* Add comment
* Iterate
* 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
* 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
* Fetch edits for thread messages
Modifies fetchEditsWhereNeeded to allow edits of threaded messages. The
code before prevented any relations from fetching edits, but of course
events in threads are relations.
We definitely want thread messages to get their edits fetched, and I
assume this is working in the real code, probably because the event
being looked at is some kind of eventmapped thing that doesn't have
proper relations visible on it.
In tests, if we don't make this change, we can't see edits getting
fetched.
* Add a test for fetching edits on demand in a thread
This test demonstrates the current behaviour, which contains a bug - we
don't actually add the right event to the timeline.
* Fix bug where original event was inserted into timeline instead of the edit event
* 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
* Fetch edits for thread messages
Modifies fetchEditsWhereNeeded to allow edits of threaded messages. The
code before prevented any relations from fetching edits, but of course
events in threads are relations.
We definitely want thread messages to get their edits fetched, and I
assume this is working in the real code, probably because the event
being looked at is some kind of eventmapped thing that doesn't have
proper relations visible on it.
In tests, if we don't make this change, we can't see edits getting
fetched.
* Add a test for fetching edits on demand in a thread
This test demonstrates the current behaviour, which contains a bug - we
don't actually add the right event to the timeline.
* 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
* Add a test for creating local echo receipts in threads
* Only add local receipt if it's after existing receipt
* Refactor local receipt tests to be shorter
* Tests for local receipts where we DO have recursive relations support
* 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
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.
* 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