Conversation
Because: - There's no guarantee that session is in the cache. - If there's no session in the cache we'd hit a run time error This Commit: - Handles the case that session is missing. - Creates empty string fallback for token getter - Creates false fallback for verified getter
chenba
approved these changes
Sep 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Because
This pull request
Issue that this pull request solves
Closes: FXA-12299
Checklist
Put an
xin the boxes that applyScreenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
I think this is okay to do. Note that sentry issue indicates this happening when users hit the
ModalVerifySessiondialog, and somehow there's not a session in the apollo cache. In this case, this PR works around the issue by essentially falling back to a session state that no sessionToken and is not verified. I feel like this fallback state adequately represents a lack of the session in the cache... This is not a typical state, however, so it's a little difficult to test. Not sure how users get into this scenario...The other tricky thing about this is that there could be a session in local storage. I considered falling back to its state, but due to the mixed cache states and the fact that state in local storage could be very old, I decided not to. If the user is on the settings page, they should really have a session in the apollo cache...