Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Defer scalar API calls until they are needed #3115
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)
Tested with both Modular (Scalar) and Dimension - both are happy with this change as far as I can tell.
bwindels left a comment
thanks for this, looks great! Just a few questions.
Also wanted to double check if we need to change anything in