Skip to content

Conversation

@LZoog
Copy link
Contributor

@LZoog LZoog commented Dec 13, 2025

Because:

  • According to some Sentry events, message.data from the fxaStatus response (FxAStatusResponse) can be undefined

This commit:

  • Updates the response to better match potential runtime behavior

closes FXA-12760


Not sure why this only seems to happen on iOS devices (clicking through a bunch of events) and (looks like there's some desktop events too) this seems to be a relatively small number of events, but it seems fine to just use the optional chaining operator when we reference this.

Also, I can just delete WebChannelExample in this branch if the reviewer agrees, I don't think we need it as a reference any longer.

Because:
* According to some Sentry events, message.data (FxAStatusResponse) can be undefined

This commit:
* Updates the response to better match potential runtime behavior to enforce undefined checks

closes FXA-12760
@LZoog LZoog requested a review from a team as a code owner December 13, 2025 00:34
service: Constants.SYNC_SERVICE,
});
if (!webChannelEngines && status.capabilities.engines) {
if (!webChannelEngines && status?.capabilities.engines) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we set defaults and return early when status and/or status.capabilities are undefined?

E.g.,

const DEFAULT_CAPABILITIES = {
  engines: [],
  choose_what_to_sync: false,
  keys_optional: false,
  can_link_account_uid: false,
  pairing: false,
};

});
signedInUser.authAt = Date.now();
signedInUser.email = status.signedInUser?.email || 'unknown';
signedInUser.email = status?.signedInUser?.email || 'unknown';
Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with removing the example entirely, but maybe it should be a separate commit/pr merged before this one?

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