DT-1170 - Update App.jsx to handle auth library not yet loaded #1741
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We're seeing intermittent failures in our e2e tests. The stacktrace suggests that it is an issue with the auth library not getting loaded before we try to access the "isLoading" field in App.jsx. This PR adds null checks to help the component more gracefully wait for the auth library to load.
Details
the error from cypress output:
From the stacktrace:
at App (http://localhost:3000/src/containers/App.jsx:195:90)
The line numbers don't match up exactly, we we directly reference auth.isLoading in several places in App.jsx. I don't think it would hurt to handle this case that "auth" is undefined a little more gracefully.
Cypress run: https://cloud.cypress.io/projects/e6ttjx/runs/3978/overview/b621a50d-ea83-43b5-ba96-4[…]-logs&roarHideRunsWithDiffGroupsAndTags=1&ts=1737432179725.8
Testing
One passing test run doesn't mean a whole lot. We'll see whether we continue to see this error out in the wild.