fix(settings): handle invalid session token on sign out#20529
Open
vpomerleau wants to merge 1 commit intomainfrom
Open
fix(settings): handle invalid session token on sign out#20529vpomerleau wants to merge 1 commit intomainfrom
vpomerleau wants to merge 1 commit intomainfrom
Conversation
Because: - If the session token no longer exists on the server, sessionDestroy returns 401/errno 110 and the avatar-menu toast strands the user with stale local state. This commit: - Swallows errno 110 in Session.destroy() so local cleanup and redirect proceed. Other errors still surface the toast. - Adds tests for Session.destroy(). Closes #FXA-13685
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the fxa-settings sign-out/session teardown path so that local sign-out cleanup still completes when the server reports the session token is already invalid (401 / errno 110), avoiding users being stranded with stale local state.
Changes:
- Swallow
ERRNO.INVALID_TOKENerrors fromauthClient.sessionDestroy()so local cleanup + redirect can proceed. - Add unit tests covering success, INVALID_TOKEN, other failures, and “no session token” behavior for
Session.destroy().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/fxa-settings/src/models/Session.ts | Catch and ignore ERRNO.INVALID_TOKEN from sessionDestroy while preserving rethrow behavior for all other errors. |
| packages/fxa-settings/src/models/Session.test.ts | Adds coverage for the new destroy() error-handling behavior and existing cleanup semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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-13685
Checklist
Put an
xin the boxes that applyHow to review (Optional)
Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
Any other information that is important to this pull request.