Skip to content

Intermittent 400 errors when hitting the API #45

@mmlngl

Description

@mmlngl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions