Skip to content

FXA-13474: “Device connected” page displays unknown browser and device after refresh#20599

Open
vbudhram wants to merge 1 commit into
mainfrom
fxa-13474
Open

FXA-13474: “Device connected” page displays unknown browser and device after refresh#20599
vbudhram wants to merge 1 commit into
mainfrom
fxa-13474

Conversation

@vbudhram
Copy link
Copy Markdown
Contributor

@vbudhram vbudhram commented May 14, 2026

No description provided.

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
Copilot AI review requested due to automatic review settings May 14, 2026 18:05
@vbudhram vbudhram requested a review from a team as a code owner May 14, 2026 18:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sessionStorage cache (PAIR_DEVICE_INFO_KEY) and lazy useState initializer 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 AuthComplete unit 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;
// Fetch supplicant metadata if not already available from props or sessionStorage
useEffect(() => {
if (suppDeviceInfoProp) {
if (suppDeviceInfoProp || deviceInfo) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may as well, add authorityIntegration to this list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants