-
Notifications
You must be signed in to change notification settings - Fork 213
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
Conversation
There was a problem hiding this 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
@@ -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')) || ''; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do - it's https://mozilla-hub.atlassian.net/browse/FXA-8267
type: VerificationReasons.RECOVERY_KEY, | ||
} | ||
), | ||
// 'post_verify/account_recovery/add_recovery_key': createViewHandler( |
There was a problem hiding this comment.
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') { |
There was a problem hiding this comment.
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.
@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
There was a problem hiding this 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', |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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...?
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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
Because
This pull request
Issue that this pull request solves
Closes: #FXA-7419
Checklist
Put an
x
in the boxes that applyScreenshots (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