* Force verification even for refreshed cients
Set a flag on login to remember that the device needs to be verified
so that we don't forget if the user refreshes the page, but still allow
user with an existing unverified session to stay logged in.
* Hopefully make matrixchat tests pass?
Much, much tweaking to make the matrixchat tests pass again. Should
hopefully make them a bit more solid in general with judicious use of
waitFor rather than flushPromises(). Also lots of fun to stop the state
bleeding between tests.
* Manual yarn.lock manipulation
to hopefully resolve infinite package sadness
* Make final test pass(?)
Mock out the createClient method to return the same client, because
we've mocked the peg to always return that client, so if we let the
code make another one having still overridden the peg, everything becomes
cursed.
Also mock out the autodiscovery stuff rather than relying on fetch-mock.
* another waitFor
* death to flushPromises
* Put the logged in dispatch back
Actually it breaks all sorts of other things too, having fixed all the
MatrixChat tests (although this is useful anyway).
* Try displaying the screen in onClientStarted instead
* Put post login screen back in logged in
but move ready transition to avoid flash of main UI
* Rejig more in the hope it does the right thing
* Make hook work before push rules are fetched
* Add test for unskippable verification
* Add test for use case selection
* Fix test
* Add playwright test for unskippable verification
* Remove console log
* Add log message to log line
* Add tsdoc
* Use useTypedEventEmitter
* Remove commented code
* Use catch instead of empty then on unawaited promises
or in one case just await it because the caller was async anyway
* Add new mock
Since Element Call has now reached production on Element X, Element Web needs to be able to at least participate in group calls. Starting a group call or creating a video room will still require the labs flags, for now.
Note that Jitsi-based video rooms are also affected by this change. This is not because we intend to delabs them (rather, we intend to get rid of them in favor of Element Call video rooms), but because it's easiest to handle both video room variants consistently.
Add a labs option which will, when set, switch into the "invisible crypto"
mode of refusing to send keys to, or decrypt messages from, devices that have
not been signed by their owner.
* Mobile registration optimizations
- don't autocaptialize or autocorrect on username field
- show each password field in their own row
- improve position of tooltip on mobile so that it's visible
* Use optional prop rather than default prop.
* Redirect to welcome screen if mobile_registration is requested but not enabled in the config.
* autocorrect value should be "off"
* Add unit tests for mobile registration
* Fix test typo
* Fix typo
* Add drafts to the RTE and tests
* test drafts in threads
* lint
* Add unit test.
* Fix test failure
* Remove unused import
* Clean up wysiwyg drafts and add test.
* Fix typo
* Add timeout to allow for wasm loading.
---------
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
* Clean up editor drafts for unknown rooms and add tests.
* lint
* Call cleanUpDraftsIfRequired when we know a live update has completed.
* Fix test for new call site of draft cleaning
* fix test
* Make tests more resilient for React 18 upgrade
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>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix widgets not being cleaned up correctly.
Widgets could persist forever because they were still sticky when we end the messaging.
Ending the messaging emits an event to which we connect ui changes that move the widget out of the screen. It does not end up in a pip view however.
So we need to make sure the widget is not persistend anymore when we call `stopMessagingByUid` so that any dom changes that remove the AppTile happen when the widget is not persistend anymore and let it destroy.
This PR also makes the role for `MatrixRTCSessionManager` more strict. We do ONLY use it in `Call.ts` and `CallStore` so that we dont end up in reaces where we updated the ui based on the session manager but not in sync with the call and callstore changes.
Rename activeCalls to connectedCalls. Active call can also be understood as a call where there are active participants but the user itself is not connected. Especially with the `hasActiveCallSession` field of the useRoomCall hook which is tracking active (not necassarly connected sessions)
* rest of the renaming
* fix test to adapt to reduced session manager event usage.
* report time to decrypt an event if it's slow
* add more stats
* fix some tests
* keep original timestamp, and report non-visible decryption failures
* add statistic for whether the user trusts their own device
* revert local playwright docker changes
* apply changes from review
* also remove logout event handler on logout
* apply changes from review
* make eventDecrypted callback private
* Store id_token rather than just id_token_claims
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Pass id_token via `id_token_hint` on `Manage Account` interaction
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Send user credentials to service worker for MSC3916 authentication
* appease linter
* Add initial test
The test fails, seemingly because the service worker isn't being installed or because the network mock can't reach that far.
* Remove unsafe access token code
* Split out base IDB operations to avoid importing `document` in serviceworkers
* Use safe crypto access for service workers
* Fix tests/unsafe access
* Remove backwards compatibility layer & appease linter
* Add docs
* Fix tests
* Appease the linter
* Iterate tests
* Factor out pickle key handling for service workers
* Enable everything we can about service workers
* Appease the linter
* Add docs
* Rename win32 image to linux in hopes of it just working
* Use actual image
* Apply suggestions from code review
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Improve documentation
* Document `??` not working
* Try to appease the tests
* Add some notes
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Take the TAC out of labs!
Requires https://github.com/matrix-org/matrix-react-sdk/pull/12438
and ideally https://github.com/matrix-org/matrix-react-sdk/pull/12418
* i18n
* Add test method
That's needed now we we don't include threads in the notif count in the tests
* One less labs setting
* Update snapshot
* Disable release announcement
* Unused import
* Fix some screenshots
* Fix all the unread test cases now room unreads don't include threads
* Fix more tests
* Even more test fixes
* Still more test fixes
* Oh goodness, it's more test fixes
* Fix selectors now there are 2 buttons called Threads
* Disable some tests that aren't passing
for reasons that don't appear releated to any of the TAC work, as
per the comment.
* Remove debugging
* Oops, removed too much
* Focus the thread panel when clicking on an item in the TAC
actually the 'close' button in the threads panel as it's the only
interactive element: we can improve this later when we use landmarks
& generally have better a11y.
* Undo minor refactoring
as none of it is test3ed, it's not worth it.
* add unit test
* Add matrixchat tests
* Needs awaits
* ts-ignore
* Fix test (I think...)
* Remove unnecessary value set
* Not how assignments work
* Fix OIDC bugs due to amnesiac stores forgetting OIDC issuer & other data
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Some of our tests, which mock a `/versions` response, currently mock the
response of a 2-year-old server. This will soon be incompatible with the
JS-SDK. Update the tests in preparation.
* Do not remove the language when clearing local storage
Signed-off-by: Milton Moura <miltonmoura@gmail.com>
* Revised comment on getting the defined language from settings
Signed-off-by: Milton Moura <miltonmoura@gmail.com>
* Explicitly checking for language set at the device level
Signed-off-by: Milton Moura <miltonmoura@gmail.com>
* Add test that checks if device language setting is kept after a successfull delegated authentication flow
Signed-off-by: Milton Moura <miltonmoura@gmail.com>
* Adds test for unhappy path and adjusts to use the SettingsStore instead of going directly to localStorage
Signed-off-by: Milton Moura <miltonmoura@gmail.com>
* Removing unnecessary variable after test refactor
Signed-off-by: Milton Moura <miltonmoura@gmail.com>
---------
Signed-off-by: Milton Moura <miltonmoura@gmail.com>
* initial
Signed-off-by: Timo K <toger5@hotmail.de>
* cleanup1
Signed-off-by: Timo K <toger5@hotmail.de>
* bring back call timer
Signed-off-by: Timo K <toger5@hotmail.de>
* more cleanup and test removals
Signed-off-by: Timo K <toger5@hotmail.de>
* remove event
Signed-off-by: Timo K <toger5@hotmail.de>
* cleanups and minor fixes
Signed-off-by: Timo K <toger5@hotmail.de>
* add matrixRTC to stubClient
Signed-off-by: Timo K <toger5@hotmail.de>
* update tests (some got removed)
The removal is a consequence of EW now doing less call logic.
More logic is done by the js sdk (MatrixRTCSession)
And therefore in EC itself.
Signed-off-by: Timo K <toger5@hotmail.de>
* cleanups
Signed-off-by: Timo K <toger5@hotmail.de>
* mock the session
Signed-off-by: Timo K <toger5@hotmail.de>
* lint
Signed-off-by: Timo K <toger5@hotmail.de>
* remove GroupCallDuration
Signed-off-by: Timo K <toger5@hotmail.de>
* review and fixing tests
Signed-off-by: Timo K <toger5@hotmail.de>
---------
Signed-off-by: Timo K <toger5@hotmail.de>
* add delegatedauthentication to validated server config
* dynamic client registration functions
* test OP registration functions
* add stubbed nativeOidc flow setup in Login
* cover more error cases in Login
* tidy
* test dynamic client registration in Login
* comment oidc_static_clients
* register oidc inside Login.getFlows
* strict fixes
* remove unused code
* and imports
* comments
* comments 2
* util functions to get static client id
* check static client ids in login flow
* remove dead code
* OidcRegistrationClientMetadata type
* navigate to oidc authorize url
* exchange code for token
* navigate to oidc authorize url
* navigate to oidc authorize url
* test
* adjust for js-sdk code
* login with oidc native flow: messy version
* tidy
* update test for response_mode query
* tidy up some TODOs
* use new types
* add identityServerUrl to stored params
* unit test completeOidcLogin
* test tokenlogin
* strict
* whitespace
* tidy
* unit test oidc login flow in MatrixChat
* strict
* tidy
* extract success/failure handlers from token login function
* typo
* use for no homeserver error dialog too
* reuse post-token login functions, test
* shuffle testing utils around
* shuffle testing utils around
* i18n
* tidy
* Update src/Lifecycle.ts
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* tidy
* comment
* update tests for id token validation
* move try again responsibility
* prettier
* add friendly error messages for oidc authorization failures
* i18n
* update for new translations, tidy
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Update Jest to more recent release
I want to use things like `jest.advanceTimersByTimeAsync`
* more jest updates
* add dep on types/prettier
* fix LegacyRoomHeader-test
* fix MatrixChat-test
* fix RoomView-test
* fix PollHistory-test
* update SidebarUserSettingsTab-test
* fix PipContainer-test
* fix UserOnboardingPage-test
* fix WidgetContextMenu-test.tsx
* Avoid `mockImplementation` for mock `matchMedia` impl
`mockImplementation` is (now) reset by `jest.resetAllMocks` and
`jest.restoreAllMocks`, which we don't really want here.
Fixes `theme-test`
* Move `mediaDevices` mock out of `setupManualMocks`
This doesn't work well in test suites with multiple tests, because the
`mockReturnValue` is reset for subsequent tests.
In any case, having it mocked out automagically is *magical*. Let's make it
opt-in.
* fix FormattingButtons-test.tsx
* fix DeviceListenerTest
* fix RoomTile-test
* utils to persist clientId and issuer after oidc authentication
* add dep oidc-client-ts
* persist issuer and clientId after successful oidc auth
* add OidcClientStore
* comments and tidy
* format
* add delegatedauthentication to validated server config
* dynamic client registration functions
* test OP registration functions
* add stubbed nativeOidc flow setup in Login
* cover more error cases in Login
* tidy
* test dynamic client registration in Login
* comment oidc_static_clients
* register oidc inside Login.getFlows
* strict fixes
* remove unused code
* and imports
* comments
* comments 2
* util functions to get static client id
* check static client ids in login flow
* remove dead code
* OidcRegistrationClientMetadata type
* navigate to oidc authorize url
* exchange code for token
* navigate to oidc authorize url
* navigate to oidc authorize url
* test
* adjust for js-sdk code
* login with oidc native flow: messy version
* tidy
* update test for response_mode query
* tidy up some TODOs
* use new types
* add identityServerUrl to stored params
* unit test completeOidcLogin
* test tokenlogin
* strict
* whitespace
* tidy
* unit test oidc login flow in MatrixChat
* strict
* tidy
* extract success/failure handlers from token login function
* typo
* use for no homeserver error dialog too
* reuse post-token login functions, test
* shuffle testing utils around
* shuffle testing utils around
* i18n
* tidy
* Update src/Lifecycle.ts
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* tidy
* comment
* update tests for id token validation
* move try again responsibility
* prettier
* use more future proof config for static clients
* test util for oidcclientconfigs
* rename type and lint
* correct oidc test util
* store issuer and clientId pre auth navigation
* adjust for js-sdk changes
* update for js-sdk userstate, tidy
* update MatrixChat tests
* update tests
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>