This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 831
Defer scalar API calls until they are needed #3115
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This moves the responsibility of creating a URL to open from the button (and other components) to the integrations manager dialog itself. By doing this, we also cut down on scalar API calls because we don't pick up on account information until the user opens the dialog.
or when needed, instead of up front.
bwindels
approved these changes
Jun 18, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for this, looks great! Just a few questions.
Also wanted to double check if we need to change anything in TextualBody.onStarterLinkClick
... probably not as the scalarclient didn't change API...
|
bwindels
approved these changes
Jun 18, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Got a lint error though:
|
3 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes element-hq/element-web#5846
In practice this means not calling scalar until one of the following things happens:
We no longer eagerly check for scalar auth everywhere, which was causing multiple calls to various endpoints at useless times. This means that the manage integrations button doesn't report errors on itself anymore (but the integration manager dialog does), the sticker picker doesn't check auth until needed, and the app drawer doesn't check for auth (instead letting the widgets do that).
After this PR, we make zero calls to scalar when switching rooms (unless the destination room has a widget) and we make zero calls on startup (unless the landing room has a widget).
The behaviour of having an empty (not undefined)
integrations_ui_url
in the config still works - the integrations server is considered disabled (see screenshots below).Tested with both Modular (Scalar) and Dimension - both are happy with this change as far as I can tell.
Integrations enabled:
Integrations disabled:
New integration manager dialog states: