Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(content): Remove deprecated recovery key creation flows #15934

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

vpomerleau
Copy link
Contributor

@vpomerleau vpomerleau commented Oct 17, 2023

Because

  • We have turned on the new account recovery key creation flow to 100% and now want to remove the old unused settings and content-server (post_verify/account_recovery) flows
  • There are no links remaining to post_verify/account_recovery - after using up a key in the account recovery flow, navigates to /settings/account_recovery

This pull request

  • Remove feature flag set up for old vs new account recovery key flow
  • Remove all code related to old PageAddRecoveryKey in fxa-settings
  • Remove all code related to old post_verify/acccount_recovery in content-server
  • Test fixes

Issue that this pull request solves

Closes: #FXA-7419

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).

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

Verified events to post_verify/account_recovery via Looker/Big Query. Few events (<20 over 6 months) that are not within a legitimate user flow. Also, conversion of this flow to React was cancelled as documented in https://mozilla-hub.atlassian.net/browse/FXA-6510?focusedCommentId=680801

@clouserw clouserw requested a review from a team October 17, 2023 22:19
@vpomerleau vpomerleau changed the title DRAFT refactor(content): Remove deprecated recovery key creation flows refactor(content): Remove deprecated recovery key creation flows Oct 18, 2023
@vpomerleau vpomerleau marked this pull request as ready for review October 18, 2023 20:48
@vpomerleau vpomerleau requested a review from a team as a code owner October 18, 2023 20:48
Copy link
Contributor

@vbudhram vbudhram left a comment

Choose a reason for hiding this comment

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

@vpomerleau Just a few nits otherwise, LGTM :shipit:

@@ -639,7 +637,7 @@ export class LoginPage extends BaseLayout {
const metaConfig = this.page.locator(
'meta[name="fxa-content-server/config"]'
);
const config = await metaConfig.getAttribute('content');
const config = (await metaConfig.getAttribute('content')) || '';
Copy link
Contributor

Choose a reason for hiding this comment

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

I added a ConfigPage, so we might be able to remove it from here.

key = await recoveryKey.getKey();
await recoveryKey.clickClose();
}
await settings.goto();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a follow up to remove the reset password routes flags? Looks like this still performs the check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

type: VerificationReasons.RECOVERY_KEY,
}
),
// 'post_verify/account_recovery/add_recovery_key': createViewHandler(
Copy link
Contributor

Choose a reason for hiding this comment

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

I say we remove these

account
);
}
// if (this.type === 'recovery_key') {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can remove this vs comment out.

@bcolsson
Copy link
Contributor

@vpomerleau - Does this need to be rebased? I'm trying to review which gettext strings are changing here, but I'm seeing lots of differences from this PR and main that were changes merged last week in different PRs.

Because:

* We have turned on the new account recovery key creation flow to 100% and now want to remove the old unused settings and content-server (post_verify/account_recovery) flows

This commit:

* Remove feature flag set up for old vs new account recovery key flow
* Remove all code related to old PageAddRecoveryKey in fxa-settings
* Remove all code related to old post_verify/acccount_recovery in content-server
* Test fixes

Closes #FXA-7419
Copy link
Contributor

@LZoog LZoog left a comment

Choose a reason for hiding this comment

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

Just a couple of functional test questions. I think it may also be worth linking to this Jira comment in your original PR comment too. But this PR is:

@@ -14,7 +14,7 @@ export const selectors = {
EMAIL_PREFILLED: '#prefillEmail',
EMAIL_HEADER: '#fxa-enter-email-header',
ERROR: '.error',
LINK_LOST_RECOVERY_KEY: 'a:has-text("Don’t have an account recovery key?")',
LINK_LOST_RECOVERY_KEY: '.lost-recovery-key',
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this selector only works with Backbone - why was this changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The previous selector didn't actually work, because the string in use for backbone has a straight quote (Don't) vs (Don’t) in the selector. I considered updating the original string, but it didn't feel worth triggering a re-translation since we're so close to stripping out the backbone flow for reset password anyway. And it seems fine for this to only work for backbone - we should be using a selector in the resetPasswordReact page (vs login) for this moving forward.

await this.page.locator(selectors.PASSWORD).fill(password);
await this.page.locator(selectors.VPASSWORD).fill(password);
}
await this.page.locator(selectors.PASSWORD).fill(password);
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar question as above, don't we need if (config.showReactApp.resetPasswordRoutes === true) { here for React...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the only spot where we were doing a config check in the page vs in the test. Also, I felt the react tests should use a selector from the resetPasswordReact page, not login.

'meta[name="fxa-content-server/config"]'
);
const config = await metaConfig.getAttribute('content');
this.page.goBack();
Copy link
Contributor

@LZoog LZoog Oct 24, 2023

Choose a reason for hiding this comment

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

We might want this.page.goBack(); in the getConfig function in config.ts. I ran into failing tests at some point without it (I think this relates to my questions above, since I think I added this when I added the if (config.showReactApp.resetPasswordRoutes === true) { check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

config.ts has page.close(), which may work just as well?

@@ -211,7 +200,7 @@ describe('App component', () => {

await navigate(HomePath + '/two_step_authentication');

expect(getByTestId('recovery-key-input')).toBeInTheDocument();
expect(getByTestId('totp-input')).toBeInTheDocument();
Copy link
Contributor

Choose a reason for hiding this comment

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

shakes fist at when we used to use data-testids everywhere

@vpomerleau vpomerleau merged commit ba515e8 into main Oct 24, 2023
6 checks passed
@vpomerleau vpomerleau deleted the FXA-7419 branch October 24, 2023 21:20
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.

4 participants