Skip to content

Conversation

@octoper
Copy link
Member

@octoper octoper commented Feb 14, 2025

Description

This PR fixes an issue with alternative method on the user re-verification modal that was shown incorrectly in specific cases like when there was not alternative method we still showed the button to go to the alternative methods screen, or like another case where we hid alternative methods that had the same strategy but they were different.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link

changeset-bot bot commented Feb 14, 2025

🦋 Changeset detected

Latest commit: 11c231e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Feb 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2025 8:24am

Copy link
Member

@panteliselef panteliselef left a comment

Choose a reason for hiding this comment

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

We we add some unit tests for at least the 2 scenarios you mentioned in the description ?

};

const hasAlternativeStrategies =
(availableFactors && availableFactors.filter(factor => isDeeplyEqual(factor, currentFactor)).length > 0) || false;
Copy link
Member

Choose a reason for hiding this comment

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

Is isDeeplyEqual necessary ? It could be an expensive operation for every render

Copy link
Member Author

Choose a reason for hiding this comment

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

This could be simplified by checking the id for each strategy, will create a utility helper to check this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

Copy link
Member

Choose a reason for hiding this comment

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

this still uses isDeeplyEqual, is this intentional ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ops, this is a leftover 🙃

@octoper octoper force-pushed the vaggelis/user-1294-alternative-verification-methods-on-modal-are-not-showing-up branch from 7cddc3b to a8a8982 Compare February 21, 2025 12:06
@octoper octoper force-pushed the vaggelis/user-1294-alternative-verification-methods-on-modal-are-not-showing-up branch from a8a8982 to ae5afe2 Compare February 24, 2025 14:31
@octoper octoper requested a review from nikospapcom February 24, 2025 14:31
@octoper octoper force-pushed the vaggelis/user-1294-alternative-verification-methods-on-modal-are-not-showing-up branch from ae5afe2 to f8cc295 Compare February 25, 2025 10:53
@octoper octoper changed the title fix(clerk-js): Correctly show alternative verification methods fix(clerk-js): Correctly show alternative re-verification methods Feb 25, 2025
Copy link
Member

@panteliselef panteliselef left a comment

Choose a reason for hiding this comment

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

I think added a few unit tests here would be beneficial to make sure we don't break things later on.

};

const hasAlternativeStrategies =
(availableFactors && availableFactors.filter(factor => isDeeplyEqual(factor, currentFactor)).length > 0) || false;
Copy link
Member

Choose a reason for hiding this comment

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

this still uses isDeeplyEqual, is this intentional ?

@octoper octoper force-pushed the vaggelis/user-1294-alternative-verification-methods-on-modal-are-not-showing-up branch from 09dc701 to 5232ca7 Compare March 4, 2025 08:57
@octoper octoper force-pushed the vaggelis/user-1294-alternative-verification-methods-on-modal-are-not-showing-up branch from 5232ca7 to febd7d5 Compare March 6, 2025 14:12
@octoper octoper force-pushed the vaggelis/user-1294-alternative-verification-methods-on-modal-are-not-showing-up branch from febd7d5 to 9dced53 Compare March 6, 2025 17:05
@octoper octoper force-pushed the vaggelis/user-1294-alternative-verification-methods-on-modal-are-not-showing-up branch from 9254503 to 11c231e Compare March 7, 2025 08:23
@octoper octoper enabled auto-merge (squash) March 7, 2025 08:24
@octoper octoper merged commit 8b5645b into main Mar 7, 2025
29 checks passed
@octoper octoper deleted the vaggelis/user-1294-alternative-verification-methods-on-modal-are-not-showing-up branch March 7, 2025 08:26
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.

5 participants