Conversation
Because: refreshing the /pair/auth/complete page caused the supplicant browser and device to render as "Unknown". The WebChannel request for supplicant metadata fails after the pairing session is complete, and the resulting error was silently swallowed. This commit: caches the fetched RemoteMetadata in sessionStorage so a refresh of the "Device connected" page restores the correct values without depending on the now-closed WebChannel session. Fixes FXA-13474
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a refresh regression on the /pair/auth/complete (“Device connected”) page where supplicant browser/OS fall back to “Unknown” because the WebChannel metadata request can no longer resolve after the pairing session is closed. The PR addresses this by caching/restoring the fetched RemoteMetadata from sessionStorage.
Changes:
- Add a
sessionStoragecache (PAIR_DEVICE_INFO_KEY) and lazyuseStateinitializer to restore device metadata on refresh. - Short-circuit metadata fetching when data is already available from props or cache, and persist successful WebChannel responses to
sessionStorage. - Extend
AuthCompleteunit tests to cover restoring/persisting cached device info.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/fxa-settings/src/pages/Pair/AuthComplete/index.tsx | Cache and restore supplicant device metadata via sessionStorage to keep browser/OS details stable on refresh. |
| packages/fxa-settings/src/pages/Pair/AuthComplete/index.test.tsx | Add tests validating restore-from-cache and persist-to-cache behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+22
to
26
| export const PAIR_DEVICE_INFO_KEY = 'pair.supp.device-info'; | ||
|
|
||
| type AuthCompleteProps = { | ||
| suppDeviceInfo?: RemoteMetadata; | ||
| supportsFirefoxView?: boolean; |
dschom
reviewed
May 15, 2026
| // Fetch supplicant metadata if not already available from props or sessionStorage | ||
| useEffect(() => { | ||
| if (suppDeviceInfoProp) { | ||
| if (suppDeviceInfoProp || deviceInfo) { |
Contributor
There was a problem hiding this comment.
You may as well, add authorityIntegration to this list.
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.
No description provided.