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

fix(recovery-phone): Invalidate previous SMS codes #18508

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

vpomerleau
Copy link
Contributor

Because

  • Old codes were not cleared

This pull request

  • Update the redis key to correctly find the old codes

Issue that this pull request solves

Closes: FXA-11111

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)

image

Other information (Optional)

Any other information that is important to this pull request.

@@ -175,7 +175,7 @@ export class RecoveryPhoneManager {
* @param uid
*/
async getAllUnconfirmed(uid: string): Promise<string[]> {
const redisKey = `${this.redisPrefix}:${uid}:*`;
const redisKey = `*:${this.redisPrefix}:${uid}:*`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure this will be efficient. Can we get this work by avoiding a '*' prefix?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at storeUnconfirmed, I don't understand why the * prefix is necessary.

Because:

* Old codes were not cleared

This commit:

* Improve performance of key search by using scan instead of keys to process the keys in batches

Closes #FXA-11111
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