element-web/src
Ed Geraghty bb4f57583f
MSC3575 (Sliding Sync) add well-known proxy support (#12307)
* Initial commit

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Remove commented code

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Change function to reflect it's proxy not native support

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Re-add check for servers with native support

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Add native support check back in

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Re-add endpoint health check function

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Use inbuilt `getWellKnown` function

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Change the error message to the correct function

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Stop storing the proxyurl in the settings for now

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Make the logger messages more useful

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Start moving the checking logic directly into the controller

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Add missing import

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Get the client rather than passing it in to the functions

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* remove invalid `function` keyword

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Fix imports

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Our new functions are private

We shouldn't(?) have to use these check in future elsewhere

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Change our proxy check function to return a boolean

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Make `nativeSlidingSyncSupport` also return boolean, add in health check

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Disable the sliding sync option if the server doesn't support

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Only enable the setting if it passes (again)

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Update our comments to better match what's going on

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Remove unused dialog

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Add a well-known check on start-up, if sliding sync has been enabled

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Check against the correct endpoint...

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Extract baseUrl as we'll reuse it

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Make the logs differentiate between the types of proxy

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Grab the client well-known directly for use

Can't use the client object at this point, it hasn't read in the well-known

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Add myself to the copyright assignation

I wrote the majority of this file...

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Only return `true` if it's actually there

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Correct the `proxySlidingSyncSupport` function comment to match the code

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Correct the `nativeSlidingSyncSupport`function comment to match the code

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Another comment/functionality paring

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Remove duplicated types from the doc

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Move await to the previous line

Removes brackets, and corrects `wellKnown` from being a `Promise`
Signed-off-by: Ed Geraghty <ed@geraghty.family>

* use `waitForClientWellKnown` to avoid a race condition with the request

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Move getting the client out of the `if`, use `waitForClientWellKnown`

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Remove `beforeChange` override

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Move proxy setup logic into `SlidingSyncManager`

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Swap `configure` to private, we call it from `setup` which handles proxy

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Promises are always `true`

TIL.
Signed-off-by: Ed Geraghty <ed@geraghty.family>

* use `timeoutSignal`

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Change message when there's no server support

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Refactor `slidingSyncHealthCheck`

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Refactor `nativeSlidingSyncSupport` with try/catch

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Change comment to hotlink

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Try and make the toggle disabled when there's no endpoint

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Move the if statement outside the refactored fn to avoid an await

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Revert "Swap `configure` to private, we call it from `setup` which handles proxy"

This reverts commit c80a00b50c261becc9ad58e08d2a893d572d8426.

* Remove unused import

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Further refactor `slidingSyncHealthCheck`

`proxySlidingSyncSupport` already checks the client well-known is there
Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Make `proxySlidingSyncSupport` log on success

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Clarify log message for proxy being up

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Move the logic into SlidingSyncManager

All so we can set a static variable because the disabled check isn't asynchronous :)

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Obviously this isn't a return so don't overwrite with false!

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Remove outdated comment

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* No need to pass in the client

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Activating SS should probably be info level logs

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* If we've not enabled sliding sync, push the logs down a bit

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Update i18n error message

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Remove unused i18n strings

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Correct log message

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Prettier

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Remove many of the log messages

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Short out of `checkSupport` if it's `true`

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Add the endpoint back into the log when we're enabling it

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Note in the comment that `feature_sliding_sync_proxy_url` is legacy

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Expand the well-known liveness check log

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* No need to stall the client waiting for sliding sync support

* `AutoDiscovery.findClientConfig` throws if the baseUrl is blank

* Fix `getProxyFromWellKnown` (?)

* Add missing semicolon

Sorry, linter!
Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Pass our `MatrixClient` through instead of trying to grab it

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Add missing return in function comment

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Actually pass through our Client, not the Peg object

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Remove SonarCube smell complaint

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Neew to make our other two methods public to test

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* First passing test

Hurrah!
Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Two more tests, this time on `checkSupport`

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Reset our `serverSupportsSlidingSync` between tests

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Check the static member is being set

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Move the static assignation down to the relevant tests

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Pull getProxyFromWellKnown mocking up

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Check we /haven't/ shorted out

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Move our spy up so we can reuse it

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Check spidering  is being called

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Test the proxy is declared

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Test entered manually

Signed-off-by: Ed Geraghty <ed@geraghty.family>

* Sorry, linter

* I guess these strings are wrong?

* Replace any with string

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Ed Geraghty <ed@geraghty.family>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2024-04-30 18:11:11 +00:00
..
@types Improve types for `sendEvent` (#12335) 2024-03-25 12:48:48 +00:00
accessibility Update dependency typescript to v5.4.5 (#12422) 2024-04-30 15:28:23 +00:00
actions Migrate more strings to translation keys (#11651) 2023-09-22 16:39:40 +01:00
async-components/views/dialogs Add support for device dehydration v2 (#12316) 2024-04-15 15:47:15 +00:00
audio Update dependency prettier to v3 (#12095) 2024-01-02 18:56:39 +00:00
autocomplete Adept KnownMembership imports for new location in types 2024-03-18 14:43:08 +00:00
components MSC3575 (Sliding Sync) add well-known proxy support (#12307) 2024-04-30 18:11:11 +00:00
contexts New context for local device verification (#12417) 2024-04-16 09:43:27 +00:00
customisations Reuse media content/info types from the js-sdk (#12308) 2024-03-11 09:30:00 +00:00
dispatcher Focus the thread panel when clicking on an item in the TAC (#12410) 2024-04-10 13:13:08 +00:00
editor Improve types for `sendEvent` (#12335) 2024-03-25 12:48:48 +00:00
effects Migrate more strings to translation keys (#11579) 2023-09-08 09:58:31 +01:00
emojipicker Enable `@typescript-eslint/explicit-function-return-type` in /src (#9788) 2023-01-12 13:25:14 +00:00
events Stop displaying verification done messages in timeline (#11932) 2023-12-01 09:12:38 +00:00
hooks Take the Threads Activity Centre out of labs (#12439) 2024-04-29 15:30:19 +00:00
i18n/strings MSC3575 (Sliding Sync) add well-known proxy support (#12307) 2024-04-30 18:11:11 +00:00
indexing Adept KnownMembership imports for new location in types 2024-03-18 14:43:08 +00:00
integrations Remove dead & duplicated code (#11405) 2023-08-15 08:43:15 +00:00
mjolnir Improve types for `sendStateEvent` (#12331) 2024-03-20 14:27:29 +00:00
models Fix external guest access url for unencrypted rooms (#12345) 2024-03-28 12:25:00 +00:00
modules Replace `SecurityCustomisations` with `CryptoSetupExtension` (#12342) 2024-04-12 15:15:17 +00:00
notifications Fix: sync intentional mentions push rules with legacy rules (#11667) 2023-09-27 00:03:38 +00:00
performance Conform more of the code base to strict null checking (#10147) 2023-02-13 17:01:43 +00:00
rageshake Add A-Element-R labels to rageshakes if rust (#12251) 2024-02-15 19:45:46 +00:00
resizer Enable strictFunctionTypes (#11201) 2023-07-07 13:37:26 +01:00
settings MSC3575 (Sliding Sync) add well-known proxy support (#12307) 2024-04-30 18:11:11 +00:00
slash-commands Improve types for `sendEvent` (#12335) 2024-03-25 12:48:48 +00:00
stores Take the Threads Activity Centre out of labs (#12439) 2024-04-29 15:30:19 +00:00
toasts Merge branch 'refs/heads/develop' into florianduros/tooltip-update 2024-04-15 15:13:51 +02:00
usercontent
utils Merge branch 'develop' into florianduros/tooltip-update 2024-04-16 09:51:05 +02:00
voice-broadcast Improve types for `sendEvent` (#12335) 2024-03-25 12:48:48 +00:00
widgets Update dependency prettier to v3 (#12095) 2024-01-02 18:56:39 +00:00
workers Appease the linter 2023-11-18 21:37:49 +01:00
AddThreepid.ts Migrate more strings to translation keys (#11651) 2023-09-22 16:39:40 +01:00
AsyncWrapper.tsx Migrate more strings to translation keys (#11651) 2023-09-22 16:39:40 +01:00
Avatar.ts Fixes read receipt avatar offset (#11483) 2023-08-30 11:47:35 +00:00
BasePlatform.ts Fix Native OIDC for Element Desktop (#12253) 2024-02-19 15:10:11 +00:00
BlurhashEncoder.ts Fix paths and extensions 2023-11-13 20:10:55 +01:00
ContentMessages.ts Improve types for `sendEvent` (#12335) 2024-03-25 12:48:48 +00:00
DateUtils.ts Port more strings to translation keys (#11474) 2023-08-31 07:35:34 +00:00
DecryptionFailureTracker.ts Use a different error message for UTDs when you weren't in the room. (#12453) 2024-04-29 17:18:57 +00:00
DeviceListener.ts DeviceListener: Remove usage of deprecated keybackup API (#11614) 2023-09-20 11:34:18 +00:00
Editing.ts Enable `@typescript-eslint/explicit-function-return-type` in /src (#9788) 2023-01-12 13:25:14 +00:00
HtmlUtils.tsx fix selector so maths support doesn't mangle divs (#12433) 2024-04-16 16:53:57 +00:00
IConfigOptions.ts Call guest access link creation to join calls as a non registered user via the EC SPA (#12259) 2024-03-07 15:38:53 +00:00
IdentityAuthClient.tsx Fix Identity Server terms accepting not working as expected (#12109) 2024-01-08 10:27:03 +00:00
ImageUtils.ts Conform more of the codebase to `strictNullChecks` (#10573) 2023-04-13 08:52:57 +01:00
KeyBindingsDefaults.ts Apply `strictNullChecks` around the codebase (#10302 2023-03-07 13:19:18 +00:00
KeyBindingsManager.ts Conform more code to `strictNullChecks` (#10374) 2023-03-16 11:07:29 +00:00
Keyboard.ts Comply with noImplicitAny (#9940) 2023-02-13 11:39:16 +00:00
LegacyCallHandler.tsx Migrate more strings to translation keys (#11651) 2023-09-22 16:39:40 +01:00
Lifecycle.ts Replace `SecurityCustomisations` with `CryptoSetupExtension` (#12342) 2024-04-12 15:15:17 +00:00
Linkify.tsx Linkify User Interactive Authentication errors (#12271) 2024-04-16 11:34:44 +01:00
Livestream.ts Pass around MatrixClients instead of using MatrixClientPeg (#10984) 2023-06-01 14:43:24 +01:00
Login.ts Replace `SecurityCustomisations` with `CryptoSetupExtension` (#12342) 2024-04-12 15:15:17 +00:00
Markdown.ts Treat lists with a single empty item as plain text, not Markdown. (#6833) 2023-08-17 16:37:19 +00:00
MatrixClientPeg.ts MSC3575 (Sliding Sync) add well-known proxy support (#12307) 2024-04-30 18:11:11 +00:00
MediaDeviceHandler.ts Migrate more strings to translation keys (#11651) 2023-09-22 16:39:40 +01:00
Modal.tsx Use new compound tooltip 2024-04-12 14:56:23 +02:00
NodeAnimator.tsx Fix regression around read receipt animation from refs changes (#12100) 2024-01-03 11:36:11 +00:00
Notifier.ts Remove Cypress & Playwright in their entirety (#12145) 2024-01-16 09:48:49 +00:00
PageTypes.ts
PasswordReset.ts Migrate more strings to translation keys (#11651) 2023-09-22 16:39:40 +01:00
PlatformPeg.ts Enable `@typescript-eslint/explicit-function-return-type` in /src (#9788) 2023-01-12 13:25:14 +00:00
PosthogAnalytics.ts Update all non-major dependencies (#12468) 2024-04-30 14:41:46 +00:00
PosthogTrackers.ts Update dependency @vector-im/compound-web to v0.9.4 (#11891) 2023-12-14 11:10:01 +00:00
Presence.ts Switch to updating presence via /sync calls instead of PUT /presence (#11824) 2023-11-01 10:49:47 +00:00
Registration.tsx Migrate more strings to translation keys (#11608) 2023-09-19 07:17:31 +01:00
Resend.ts Switch to importing models/Room from main js-sdk export (#11361) 2023-08-04 07:36:16 +00:00
Roles.ts Migrate more strings to translation keys (#11498) 2023-08-31 11:22:10 +01:00
RoomAliasCache.ts Conform more of the code base to strict null checking (#10147) 2023-02-13 17:01:43 +00:00
RoomInvite.tsx Migrate more strings to translation keys (#11651) 2023-09-22 16:39:40 +01:00
RoomNotifs.ts Mark as Unread (#12254) 2024-03-19 13:28:20 +00:00
Rooms.ts Switch to importing models/Room from main js-sdk export (#11361) 2023-08-04 07:36:16 +00:00
ScalarAuthClient.ts Update dependency prettier to v3 (#12095) 2024-01-02 18:56:39 +00:00
ScalarMessaging.ts Avoid using deprecated exports & methods from matrix-js-sdk (#12359) 2024-03-25 12:21:02 +00:00
SdkConfig.ts Show all labs flags if developerMode enabled (#11746) 2023-10-13 13:24:00 +00:00
Searching.ts Switch to importing more things from the main js-sdk export (#11377) 2023-08-10 08:01:14 +00:00
SecurityManager.ts Replace `SecurityCustomisations` with `CryptoSetupExtension` (#12342) 2024-04-12 15:15:17 +00:00
SendHistoryManager.ts Switch to importing models/event from main js-sdk export (#11363) 2023-08-07 08:24:58 +00:00
SlashCommands.tsx Merge branch 'develop' into andybalaam/stas-demydiuk-membership-type3 2024-03-20 17:25:23 +00:00
SlidingSyncManager.ts MSC3575 (Sliding Sync) add well-known proxy support (#12307) 2024-04-30 18:11:11 +00:00
Terms.ts Update dependency prettier to v3 (#12095) 2024-01-02 18:56:39 +00:00
TextForEvent.tsx Adept KnownMembership imports for new location in types 2024-03-18 14:43:08 +00:00
Typeguards.ts RTE plain text mentions as pills (#10852) 2023-05-16 11:54:16 +00:00
Unread.ts Pop out of Threads Activity Centre (#12136) 2024-02-07 13:49:40 +00:00
UserActivity.ts Update dependency prettier to v3 (#12095) 2024-01-02 18:56:39 +00:00
UserAddress.ts
Views.ts Lock out the first tab if Element is opened in a second tab. (#11425) 2023-08-24 08:28:43 +00:00
VoipUserMapper.ts Adept KnownMembership imports for new location in types 2024-03-18 14:43:08 +00:00
WhoIsTyping.ts Migrate more strings to translation keys (#11530) 2023-09-05 10:44:41 +01:00
WorkerManager.ts Load web workers in a way that Webpack 5 can bundle them 2023-11-11 16:03:08 +01:00
boundThreepids.ts Consume more imports from matrix-js-sdk/src/matrix (#11449) 2023-08-23 09:04:25 +00:00
call-types.ts Extract types for re-use in matrix-js-sdk.d.ts (#12350) 2024-03-19 10:19:38 +00:00
createRoom.ts Avoid using deprecated exports & methods from matrix-js-sdk (#12359) 2024-03-25 12:21:02 +00:00
email.ts Factor out basic email check (#10244) 2023-02-28 10:39:35 +01:00
identifiers.ts
index.ts
languageHandler.tsx Update custom translations to support nested fields in structured JSON (#11685) 2023-10-02 10:44:25 +00:00
linkify-matrix.ts Enable redirected media by default (#12142) 2024-02-11 07:32:57 +00:00
phonenumber.ts Get country names from the browser instead of manual i18n (#11428) 2023-08-22 16:15:16 +00:00
sendTimePerformanceMetrics.ts Enable `@typescript-eslint/explicit-function-return-type` in /src (#9788) 2023-01-12 13:25:14 +00:00
sentry.ts Update dependency @sentry/browser to v7.94.1 (#12171) 2024-01-24 09:23:54 +00:00
shouldHideEvent.ts Adept KnownMembership imports for new location in types 2024-03-18 14:43:08 +00:00
theme.ts Revert "Make EC widget theme reactive - Update widget url when the theme chan…" (#12382) 2024-03-28 12:04:14 +00:00
verification.ts Remove references to `matrix-js-sdk/src/crypto/verification` (#12365) 2024-03-25 17:44:45 +00:00