What
Check the console when clicking around the site. You'll see random 400 errors to our api.
Why
The async loading of the user's Firebase profile must happen before we make any requests to our API as we need to request the user's access token. The 400 errors are happening because no token has yet loaded.
More details
Adding a token is handled by ApolloProvider.tsx – it sets up a new client every time the token changes but¬ it's a bit buggy.
Partial Fix
I tried to make the page sit in a loading state until Firebase has done it's thing using the PrivateRoute.tsxcomponent. It improved things, but we still see the errors.
What
Check the console when clicking around the site. You'll see random 400 errors to our api.
Why
The async loading of the user's Firebase profile must happen before we make any requests to our API as we need to request the user's access token. The 400 errors are happening because no token has yet loaded.
More details
Adding a token is handled by
ApolloProvider.tsx– it sets up a new client every time the token changes but¬ it's a bit buggy.Partial Fix
I tried to make the page sit in a loading state until Firebase has done it's thing using the
PrivateRoute.tsxcomponent. It improved things, but we still see the errors.