Skip to content

Commit 44b072d

Browse files
authored
Merge pull request #20165 from mozilla/FXA-12760-v2
fix(fxa_status): Allow status.capabilities to be undefined
2 parents bcf541b + 0638404 commit 44b072d

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

  • packages/fxa-settings/src/lib/hooks/useFxAStatus

packages/fxa-settings/src/lib/hooks/useFxAStatus/index.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,30 +57,35 @@ export function useFxAStatus(integration: FxAStatusIntegration) {
5757
isPairing: false,
5858
service: Constants.SYNC_SERVICE,
5959
});
60-
if (!webChannelEngines && status.capabilities.engines) {
60+
61+
// Very old versions of Firefox iOS do not send `capabilities` in the
62+
// fxa_status response. This suppresses TypeErrors due to this.
63+
const capabilities = status.capabilities || {};
64+
65+
if (!webChannelEngines && capabilities.engines) {
6166
// choose_what_to_sync may be disabled for mobile sync, see:
6267
// https://github.com/mozilla/application-services/issues/1761
6368
// Desktop OAuth Sync will always provide this capability too
6469
// for consistency.
6570
if (
6671
isSyncDesktopV3 ||
67-
(isSyncOAuth && status.capabilities.choose_what_to_sync)
72+
(isSyncOAuth && capabilities.choose_what_to_sync)
6873
) {
69-
setWebChannelEngines(status.capabilities.engines);
74+
setWebChannelEngines(capabilities.engines);
7075
}
7176
}
7277
// Check if third party auth (passwordless) log in to the browser is supported,
7378
// currently only Firefox desktop 147+ as of Q1 2026
7479
if (
75-
status.capabilities.keys_optional &&
80+
capabilities.keys_optional &&
7681
isOAuthNative &&
7782
integration.isFirefoxNonSync()
7883
) {
7984
setSupportsKeysOptionalLogin(true);
8085
} else {
8186
setSupportsKeysOptionalLogin(false);
8287
}
83-
if (status.capabilities.can_link_account_uid) {
88+
if (capabilities.can_link_account_uid) {
8489
setSupportsCanLinkAccountUid(true);
8590
} else {
8691
setSupportsCanLinkAccountUid(false);

0 commit comments

Comments
 (0)