This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Initial commit Signed-off-by: Ed Geraghty <[email protected]> * Remove commented code Signed-off-by: Ed Geraghty <[email protected]> * Change function to reflect it's proxy not native support Signed-off-by: Ed Geraghty <[email protected]> * Re-add check for servers with native support Signed-off-by: Ed Geraghty <[email protected]> * Add native support check back in Signed-off-by: Ed Geraghty <[email protected]> * Re-add endpoint health check function Signed-off-by: Ed Geraghty <[email protected]> * Use inbuilt `getWellKnown` function Signed-off-by: Ed Geraghty <[email protected]> * Change the error message to the correct function Signed-off-by: Ed Geraghty <[email protected]> * Stop storing the proxyurl in the settings for now Signed-off-by: Ed Geraghty <[email protected]> * Make the logger messages more useful Signed-off-by: Ed Geraghty <[email protected]> * Start moving the checking logic directly into the controller Signed-off-by: Ed Geraghty <[email protected]> * Add missing import Signed-off-by: Ed Geraghty <[email protected]> * Get the client rather than passing it in to the functions Signed-off-by: Ed Geraghty <[email protected]> * remove invalid `function` keyword Signed-off-by: Ed Geraghty <[email protected]> * Fix imports Signed-off-by: Ed Geraghty <[email protected]> * Our new functions are private We shouldn't(?) have to use these check in future elsewhere Signed-off-by: Ed Geraghty <[email protected]> * Change our proxy check function to return a boolean Signed-off-by: Ed Geraghty <[email protected]> * Make `nativeSlidingSyncSupport` also return boolean, add in health check Signed-off-by: Ed Geraghty <[email protected]> * Disable the sliding sync option if the server doesn't support Signed-off-by: Ed Geraghty <[email protected]> * Only enable the setting if it passes (again) Signed-off-by: Ed Geraghty <[email protected]> * Update our comments to better match what's going on Signed-off-by: Ed Geraghty <[email protected]> * Remove unused dialog Signed-off-by: Ed Geraghty <[email protected]> * Add a well-known check on start-up, if sliding sync has been enabled Signed-off-by: Ed Geraghty <[email protected]> * Check against the correct endpoint... Signed-off-by: Ed Geraghty <[email protected]> * Extract baseUrl as we'll reuse it Signed-off-by: Ed Geraghty <[email protected]> * Make the logs differentiate between the types of proxy Signed-off-by: Ed Geraghty <[email protected]> * 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 <[email protected]> * Add myself to the copyright assignation I wrote the majority of this file... Signed-off-by: Ed Geraghty <[email protected]> * Only return `true` if it's actually there Signed-off-by: Ed Geraghty <[email protected]> * Correct the `proxySlidingSyncSupport` function comment to match the code Signed-off-by: Ed Geraghty <[email protected]> * Correct the `nativeSlidingSyncSupport`function comment to match the code Signed-off-by: Ed Geraghty <[email protected]> * Another comment/functionality paring Signed-off-by: Ed Geraghty <[email protected]> * Remove duplicated types from the doc Signed-off-by: Ed Geraghty <[email protected]> * Move await to the previous line Removes brackets, and corrects `wellKnown` from being a `Promise` Signed-off-by: Ed Geraghty <[email protected]> * use `waitForClientWellKnown` to avoid a race condition with the request Signed-off-by: Ed Geraghty <[email protected]> * Move getting the client out of the `if`, use `waitForClientWellKnown` Signed-off-by: Ed Geraghty <[email protected]> * Remove `beforeChange` override Signed-off-by: Ed Geraghty <[email protected]> * Move proxy setup logic into `SlidingSyncManager` Signed-off-by: Ed Geraghty <[email protected]> * Swap `configure` to private, we call it from `setup` which handles proxy Signed-off-by: Ed Geraghty <[email protected]> * Promises are always `true` TIL. Signed-off-by: Ed Geraghty <[email protected]> * use `timeoutSignal` Signed-off-by: Ed Geraghty <[email protected]> * Change message when there's no server support Signed-off-by: Ed Geraghty <[email protected]> * Refactor `slidingSyncHealthCheck` Signed-off-by: Ed Geraghty <[email protected]> * Refactor `nativeSlidingSyncSupport` with try/catch Signed-off-by: Ed Geraghty <[email protected]> * Change comment to hotlink Signed-off-by: Ed Geraghty <[email protected]> * Try and make the toggle disabled when there's no endpoint Signed-off-by: Ed Geraghty <[email protected]> * Move the if statement outside the refactored fn to avoid an await Signed-off-by: Ed Geraghty <[email protected]> * Revert "Swap `configure` to private, we call it from `setup` which handles proxy" This reverts commit c80a00b. * Remove unused import Signed-off-by: Ed Geraghty <[email protected]> * Further refactor `slidingSyncHealthCheck` `proxySlidingSyncSupport` already checks the client well-known is there Signed-off-by: Ed Geraghty <[email protected]> * Make `proxySlidingSyncSupport` log on success Signed-off-by: Ed Geraghty <[email protected]> * Clarify log message for proxy being up Signed-off-by: Ed Geraghty <[email protected]> * 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 <[email protected]> * Obviously this isn't a return so don't overwrite with false! Signed-off-by: Ed Geraghty <[email protected]> * Remove outdated comment Signed-off-by: Ed Geraghty <[email protected]> * No need to pass in the client Signed-off-by: Ed Geraghty <[email protected]> * Activating SS should probably be info level logs Signed-off-by: Ed Geraghty <[email protected]> * If we've not enabled sliding sync, push the logs down a bit Signed-off-by: Ed Geraghty <[email protected]> * Update i18n error message Signed-off-by: Ed Geraghty <[email protected]> * Remove unused i18n strings Signed-off-by: Ed Geraghty <[email protected]> * Correct log message Signed-off-by: Ed Geraghty <[email protected]> * Prettier Signed-off-by: Ed Geraghty <[email protected]> * Remove many of the log messages Signed-off-by: Ed Geraghty <[email protected]> * Short out of `checkSupport` if it's `true` Signed-off-by: Ed Geraghty <[email protected]> * Add the endpoint back into the log when we're enabling it Signed-off-by: Ed Geraghty <[email protected]> * Note in the comment that `feature_sliding_sync_proxy_url` is legacy Signed-off-by: Ed Geraghty <[email protected]> * Expand the well-known liveness check log Signed-off-by: Ed Geraghty <[email protected]> * 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 <[email protected]> * Pass our `MatrixClient` through instead of trying to grab it Signed-off-by: Ed Geraghty <[email protected]> * Add missing return in function comment Signed-off-by: Ed Geraghty <[email protected]> * Actually pass through our Client, not the Peg object Signed-off-by: Ed Geraghty <[email protected]> * Remove SonarCube smell complaint Signed-off-by: Ed Geraghty <[email protected]> * Neew to make our other two methods public to test Signed-off-by: Ed Geraghty <[email protected]> * First passing test Hurrah! Signed-off-by: Ed Geraghty <[email protected]> * Two more tests, this time on `checkSupport` Signed-off-by: Ed Geraghty <[email protected]> * Reset our `serverSupportsSlidingSync` between tests Signed-off-by: Ed Geraghty <[email protected]> * Check the static member is being set Signed-off-by: Ed Geraghty <[email protected]> * Move the static assignation down to the relevant tests Signed-off-by: Ed Geraghty <[email protected]> * Pull getProxyFromWellKnown mocking up Signed-off-by: Ed Geraghty <[email protected]> * Check we /haven't/ shorted out Signed-off-by: Ed Geraghty <[email protected]> * Move our spy up so we can reuse it Signed-off-by: Ed Geraghty <[email protected]> * Check spidering is being called Signed-off-by: Ed Geraghty <[email protected]> * Test the proxy is declared Signed-off-by: Ed Geraghty <[email protected]> * Test entered manually Signed-off-by: Ed Geraghty <[email protected]> * Sorry, linter * I guess these strings are wrong? * Replace any with string Co-authored-by: Michael Telatynski <[email protected]> --------- Signed-off-by: Ed Geraghty <[email protected]> Co-authored-by: Michael Telatynski <[email protected]>
- Loading branch information