Skip to content
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

Intermittent 400 errors when hitting the API #45

Open
mmmoli opened this issue Mar 29, 2020 · 0 comments
Open

Intermittent 400 errors when hitting the API #45

mmmoli opened this issue Mar 29, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@mmmoli
Copy link
Member

mmmoli commented Mar 29, 2020

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.

@mmmoli mmmoli added the bug Something isn't working label Mar 29, 2020
@mmmoli mmmoli changed the title Intermittent 404 errors Intermittent 400 errors when hitting the API Apr 3, 2020
mmmoli added a commit that referenced this issue Apr 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant