-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
⚡️ decrease time-to-interactive #162
Conversation
Wow! Sounds awesome. I'll try to review and test it this week. |
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
ui/src/index.ts
Outdated
</h2>`; | ||
</div>`; | ||
|
||
const statsLoader = `<h2>${htmlLoader} Hold on, we're retrieving the data you requested ...</h2>`; |
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.
For accessibility, can we use something else than a h2 to display information that is not really a title ?
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.
I put a div instead
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.
I'm afraid removing the call to Auth0 is not that easy. Your proposal is not secured. Anyone can call exchangeToken
with any values for userId
, userEmail
, accessToken
and get authenticated to Firebase. In the master
version, the value for accessToken
is validated against Auth0, which ensures that the token is legitimate and that the user really did authenticate to Auth0. This is why Auth0 is called, not just to get the email address. 🙂
f132f23
to
ae2ff6c
Compare
ae2ff6c
to
993f156
Compare
Indeed I forgot it was in an API function and thus not redundant with the authentication. I dropped the commit. Hopefully with the optimistic UI it should still feel faster, but the total logging time will remain roughly the same (very long). So I am not sure if this PR can still close the associated issue ? It strange that some API calls take much more time on the production app than locally, but I won't be able to further analyse this issue. |
I'll come back to this PR next week :) |
I might have solution for the Auth0 call, see #41 (comment), but let's keep that for another PR. |
Finally got around to test this. It works nicely, thank you. I think it can be improved further. In the current form, the Stats button in the navbar is unresponsive while authenticating to Firebase. I don't think this has to happen. I'm gonna to test a few adjustment to see what I can do. |
OK, found something that works a bit better IMO, since it's now possible to navigate to the stats page immediately. |
Related to #41
I made quite a few changes, I hope it is not too much for one PR. But the logging time (at least perceived) is much shorter.
Here is what I did:
authenticationClient.getProfile()
in theexchangeToken
function, which was not necessary since all we got from it was the user email, which we already have from the auth0 authentication. The call to this function was one of the longest so I think we can save several seconds on the production app just by removing it.