Skip to content

Use query params to check which device needs verif #560

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

Merged
merged 8 commits into from
May 15, 2025

Conversation

crisnicandrei
Copy link
Contributor

Steps to test:

Add phone number
Click verify phone
it should redirect you as expected to phone verification

Navigate back
Go to email verification
It should take you to email verification

Copy link

codecov bot commented Apr 29, 2025

Codecov Report

Attention: Patch coverage is 55.55556% with 12 lines in your changes missing coverage. Please review.

Project coverage is 44.59%. Comparing base (c649aef) to head (6551396).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
src/app/auth/components/verify/verify.component.ts 52.00% 8 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #560      +/-   ##
==========================================
+ Coverage   44.51%   44.59%   +0.07%     
==========================================
  Files         370      370              
  Lines       11311    11314       +3     
  Branches     1862     1864       +2     
==========================================
+ Hits         5035     5045      +10     
+ Misses       6103     6095       -8     
- Partials      173      174       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@crisnicandrei crisnicandrei requested a review from slifty May 6, 2025 12:49
Copy link
Contributor

@slifty slifty left a comment

Choose a reason for hiding this comment

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

Slight suggested refactor to make sure the code is easy to understand later; also it looks like tests currently fail.

@crisnicandrei crisnicandrei requested a review from slifty May 12, 2025 14:20
Copy link
Contributor

@slifty slifty left a comment

Choose a reason for hiding this comment

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

Sorry for still more changes here.

Right now this component has just too many potentially conflicting state-representing-attributes.

We should just have one: currentVerifyFlow

The value of that single attribute should determine what language is rendered, what flows are followed, etc.

Also I looked at the rest of the component and it looks like there is a bit of redundant logic which hasn't been updated. (for instance: onSubmit has return verifyPromise which has a bunch of logic around form titles and other things.). I couldn't add a comment insline since it's not part of the diff, but we should got through the entire component and clean it up / remove redundant logic and shift to currentVerifyFlow

@crisnicandrei
Copy link
Contributor Author

@slifty thanks Dan! This is such a great suggestion! Sorry I didn't catch it earlier

@crisnicandrei crisnicandrei force-pushed the PER-9519-fix-phone-email-verif branch from fe98feb to 20f21b4 Compare May 12, 2025 20:33
@crisnicandrei crisnicandrei requested a review from slifty May 12, 2025 20:34
@crisnicandrei crisnicandrei force-pushed the PER-9519-fix-phone-email-verif branch from 20f21b4 to 700f82b Compare May 12, 2025 20:39
Copy link
Contributor

@slifty slifty left a comment

Choose a reason for hiding this comment

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

I really appreciate the iteration on this! Code is looking to be in a great place, and this is ready for QA

@crisnicandrei crisnicandrei requested a review from k8lyn6 May 14, 2025 21:17
Copy link

@k8lyn6 k8lyn6 left a comment

Choose a reason for hiding this comment

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

This works great! I tested:

  • Adding my phone number, immediately verifying phone number, then verifying email
  • Adding my phone number, verifying my email, then verifying my number
  • Verifying my email, adding my phone number, then verifying my phone number
  • Changing my phone number and reverifying it

I did notice while testing that the verify phone number button is clickable even if the phone number field is blank, which drops you into phone verification with an error. We should probably disable that field if the phone number is blank. I created a ticket here. I also created a ticket for a small bug that makes the "verified" status persist even though there's no phone number entered.

If you want to pick up either of these, you're welcome to @crisnicandrei ! They aren't particularly urgent though, so we can wait for the next cross team grooming to discuss them.

- Removed verifyingEmail, verifyingPhone, and formTitle properties
- Refactored component logic and template to use currentVerifyFlow exclusively
- Updated unit tests to align with new flow-based state model
- Improved maintainability and reduced risk of inconsistent state
@crisnicandrei crisnicandrei force-pushed the PER-9519-fix-phone-email-verif branch from 700f82b to 6551396 Compare May 15, 2025 18:42
@crisnicandrei crisnicandrei merged commit 0b00a85 into main May 15, 2025
2 checks passed
@crisnicandrei crisnicandrei deleted the PER-9519-fix-phone-email-verif branch May 15, 2025 18:46
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