Skip to content

fix(settings): add fxa_pairflow entrypoint to direct pair visits - #21255

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

vbudhram wants to merge 1 commit into
mainfrom
fxa-14556

Conversation

@vbudhram

@vbudhram vbudhram commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Because

  • A verified Sync user returns early, before the OAuth redirect block, so the stash for the pairing approval page was {}.
  • IntegrationFactory copies entryPoint to entrypoint only when both keys are present, so /pair?entryPoint=fx-view reached the page with no entrypoint and got relabeled fxa_pairflow.
  • Review on fix(settings): add fxa_pairflow entrypoint to direct pair visits #21255 asked for the default to cover every consumer, not just the redirect.

This pull request

  • Sets the fxa_pairflow default in the shared pairingAttribution memo, so the sign-in redirect, the stash, and the download URL all pick it up.
  • Checks the URL attribution before falling back to the default, so a capital-P entryPoint value survives.
  • Drops the entrypoint default from the OAuth redirect block in index.tsx.
  • Folds the three redirect entrypoint tests into one it.each covering the URL, the integration, and a capital-P URL param.
  • Adds a test for the stash on a signed-in direct visit.

Issue that this pull request solves

Closes: https://mozilla-hub.atlassian.net/browse/FXA-14556

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on: the pairingAttribution memo in Pair/Index/index.tsx.
  • Suggested review order: the memo, then the default deleted from the OAuth redirect block, then the tests.
  • Risky or complex parts: the metrics label change noted below.

Screenshots (Optional)

No UI changes.

Other information (Optional)

Ran locally:

  • npx jest src/pages/Pair/Index (fxa-settings): 82 passed, 0 failed.
  • tsc -p packages/fxa-settings/tsconfig.json --noEmit and npx nx lint fxa-settings: 0 errors.

I did not run the functional tests locally.

Heads up for metrics owners: the stash is never empty now, so applyPairingAttribution() no longer reaches its preferences fallback branch. A pairing that starts from about:preferences inside the 30 minute TTL now reports fxa_pairflow on the approval page.

@vbudhram
vbudhram requested a review from a team as a code owner September 18, 2026 14:33
@vbudhram vbudhram added the auto label Sep 18, 2026
Copilot AI balanced review requested due to automatic review settings September 18, 2026 14:33

Copilot AI left a comment

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.

🟡 Changes recommended

Existing capitalized attribution and already-signed-in visits are not handled correctly.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds default pairing attribution for direct /pair visits during sign-in redirects.

Changes:

  • Defines the fxa_pairflow entrypoint.
  • Preserves existing attribution when redirecting.
  • Adds redirect attribution tests.
File summaries
File Description
packages/fxa-settings/src/pages/Pair/Index/index.tsx Applies attribution to sign-in redirects.
packages/fxa-settings/src/pages/Pair/Index/index.test.tsx Tests default and existing entrypoints.
packages/fxa-settings/src/lib/pairing-attribution.ts Defines the pairing entrypoint constant.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +333 to +335
if (!search.has('entrypoint')) {
search.set('entrypoint', PAIR_FLOW_ENTRYPOINT);
}
Comment on lines +333 to +335
if (!search.has('entrypoint')) {
search.set('entrypoint', PAIR_FLOW_ENTRYPOINT);
}
## Because

- A verified Sync user returns early, before the OAuth redirect block, so the stash for the pairing approval page was `{}`.
- `IntegrationFactory` copies `entryPoint` to `entrypoint` only when both keys are present, so `/pair?entryPoint=fx-view` reached the page with no entrypoint and got relabeled `fxa_pairflow`.
- Review on #21255 asked for the default to cover every consumer, not just the redirect.

## This pull request

- Sets the `fxa_pairflow` default in the shared `pairingAttribution` memo, so the sign-in redirect, the stash, and the download URL all pick it up.
- Checks the URL attribution before falling back to the default, so a capital-P `entryPoint` value survives.
- Drops the entrypoint default from the OAuth redirect block in `index.tsx`.
- Folds the three redirect entrypoint tests into one `it.each` covering the URL, the integration, and a capital-P URL param.
- Adds a test for the stash on a signed-in direct visit.

## Issue that this pull request solves

Closes: https://mozilla-hub.atlassian.net/browse/FXA-14556
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants