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

[HOLD for payment 2023-07-14] [$1000] Settings - On Share Code page number is not displayed in formatted as we displayed on other pages #20931

Closed
6 tasks done
kbecciv opened this issue Jun 16, 2023 · 65 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Jun 16, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Login to ND (with number login)
  2. Navigate to settings
  3. Navigate to share code screen
  4. Notice subtitle on QR view shows phone number with email extension (not formatted as we can see on setting page)

Expected Result:

Phone number should be formatted as we can see on profile page

Actual Result:

Phone number is not formatted as we does on other pages like (profile page ,account close page )

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.16-3

Reproducible in staging?: yes

Reproducible in production?: yes

If this was caught during regression testing, add the test name, ID and link from TestRail:

Email or phone of affected tester (no customers):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

Simulator Screenshot - iPhone 14 - 2023-05-22 at 12 26 35

Simulator Screenshot - iPhone 14 - 2023-05-22 at 12 26 39

Expensify/Expensify Issue URL:

Issue reported by: @dhairyasenjaliya

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1684739607316259

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d6e5878ab0553a59
  • Upwork Job ID: 1671639469433528320
  • Last Price Increase: 2023-06-28
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

Triggered auto assignment to @alexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@dhairyasenjaliya
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

  • On Share Code page number is not displayed in formatted as we displayed on other pages

What is the root cause of that problem?

  • The root cause is we are not converting the login/email to display in formatted

What changes do you think we should make in order to solve the problem?

  • We need to add apply formatPhoneNumber function to formatted phone number to remove @Expensify extension on ShareCodePage.js
  • Optionally we can also ise
const formattedPhone = this.props.formatPhoneNumber(this.props.session.email)
 <QRShareWithDownload  subtitle={isReport ? subtitle : formattedPhone}    /> 

@alexpensify
Copy link
Contributor

This one is on my test list

@melvin-bot melvin-bot bot added the Overdue label Jun 20, 2023
@alexpensify
Copy link
Contributor

I'll be testing soon!

@melvin-bot melvin-bot bot removed the Overdue label Jun 20, 2023
@alexpensify
Copy link
Contributor

I've reviewed the Slack convo and will be assigning it to External since this one is not a dupe.

@alexpensify alexpensify added the External Added to denote the issue can be worked on by a contributor label Jun 21, 2023
@melvin-bot melvin-bot bot changed the title Settings - On Share Code page number is not displayed in formatted as we displayed on other pages [$1000] Settings - On Share Code page number is not displayed in formatted as we displayed on other pages Jun 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01d6e5878ab0553a59

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 2023

Current assignee @alexpensify is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (External)

@tienifr
Copy link
Contributor

tienifr commented Jun 22, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Phone number is not formatted on Share Code page as we does on other pages like (profile page ,account close page )

What is the root cause of that problem?

It's here

subtitle={isReport ? subtitle : this.props.session.email}
where we'll be showing the this.props.session.email without formatting it first by formatPhoneNumber.

What changes do you think we should make in order to solve the problem?

I've noticed we have this kind of issue many times once in a while where we show the "unformatted" email in different places. It seems that we tend to forget that the this.props.session.email itself cannot be used for display purpose, and the usage of formatPhoneNumber to format the sessionEmail is duplicated across the code base. So I'd like to suggest a solution that will help us get rid of it and not face it again in the future:

  1. We centralize the formatted session email, we can create a hook like withSession where we'll additionally return the field displayEmail that's already formatted with formatPhoneNumber.
  2. Update the existing places where formatted session email is used, to use the new hook and the new field displayEmail.
  3. In the future whenever we use the session email for display purpose, we'll need to use the session.displayEmail and not forget it any more.
  4. If the displayEmail has any additional formatting rules in the future, we can just update in withSession without updating across the codebase, since our code is now DRY and the concern of formatting the email is now isolated in the hook, not in the component.

What alternative solutions did you explore? (Optional)

NA

@wysohn
Copy link

wysohn commented Jun 22, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

email isn't properly formatted in Share Code page as it does in Initial Settings page

What is the root cause of that problem?

props.session.email is being used directly without going through formatPhoneNumber

What changes do you think should make in order to solve the problem?

Replace

subtitle={isReport ? subtitle : this.props.session.email}

to

subtitle={isReport ? subtitle : this.props.formatPhoneNumber(this.props.session.email)}

@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

📣 @wysohn! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@wysohn
Copy link

wysohn commented Jun 22, 2023

Contributor details
Your Expensify account email: wysohn2012@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~016a986842f84635e0

@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@nikhiln
Copy link

nikhiln commented Jun 22, 2023

Proposal


Please re-state the problem that we are trying to solve in this issue.

Settings - Share code barcode - phone number is not formatted with valid format (uses email formatting instead of the regular phone number formatting being used across the app)

What is the root cause of that problem?

The ShareCodePage component is trying to use the email available on the session without applying the formatting.

What changes do you think we should make in order to solve the problem?

It appears that we are currently encountering an issue where we missed to use the formatPhoneNumber method. This oversight is causing a display bug within a particular component or would cause the same at other places when not using the formatPhoneNumber method explicitly. Instead of relying on the current way, a more effective approach would be to directly expose the displayedSessionName field from the withCurrentUserPersonalDetails component, ensuring that it already contains the formatted value (either email or phone, based on the authentication type). By doing so, we can then proceed to use this pre-formatted value consistently throughout the application.

What alternative solutions did you explore? (Optional)

NA

@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

📣 @nikhiln! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@nikhiln
Copy link

nikhiln commented Jun 22, 2023

Contributor details
Your Expensify account email: nikhil.navadiya@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0128e76e442a99847c

@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@alexpensify
Copy link
Contributor

@fedirjh - when you get a chance, can you review the proposals to identify if they will work to resolve the problem? Thank you!

@fedirjh
Copy link
Contributor

fedirjh commented Jun 23, 2023

@tienifr Thanks for the proposal. Can you elaborate more on which places we use the formatPhoneNumber to format the session.email ?

we can create a hook like withSession

Are you referring to hook or HOC ?

Update the existing places where formatted session email is used, to use the new hook and the new field displayEmail.

But won't that serve same as formatPhoneNumber, in other words we will just replace formatPhoneNumber with the new util (hook or HOC) , what the benefits of this refactor ?

If the displayEmail has any additional formatting rules in the future, we can just update in withSession without updating across the codebase

we still can do the same to formatPhoneNumber util, no ?

since our code is now DRY and the concern of formatting the email is now isolated in the hook, not in the component.

Honestly I feel this solution is over-engineered. Unless if I am missing something. I would like to see which other components uses session.email.

@fedirjh
Copy link
Contributor

fedirjh commented Jun 23, 2023

@tienifr Another thing to mention , we have a HOC WithCurrentUserPersonalDetails , we can apply your solution there, let's first get an insight about affected components.

@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

📣 @fedirjh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

📣 @dhairyasenjaliya 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

📣 @dhairyasenjaliya 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Upwork job

@MonilBhavsar
Copy link
Contributor

@dhairyasenjaliya feel free to open a PR

@melvin-bot melvin-bot bot removed the Overdue label Jul 5, 2023
@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Jul 5, 2023
@dhairyasenjaliya
Copy link
Contributor

Pr ready for review @fedirjh @MonilBhavsar

@MonilBhavsar
Copy link
Contributor

Merged PR. Thanks all for the quick work!

@sakluger
Copy link
Contributor

sakluger commented Jul 5, 2023

So fast! Nice work everyone.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jul 7, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Settings - On Share Code page number is not displayed in formatted as we displayed on other pages [HOLD for payment 2023-07-14] [$1000] Settings - On Share Code page number is not displayed in formatted as we displayed on other pages Jul 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 7, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 7, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.37-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-07-14. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jul 7, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@fedirjh] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@fedirjh] Determine if we should create a regression test for this bug.
  • [@fedirjh] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@sakluger / @alexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@alexpensify
Copy link
Contributor

Alright, removing the other 🐛 team member. I'm back online and see that this is our current state:

Prepare for payment

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 13, 2023
@alexpensify
Copy link
Contributor

alexpensify commented Jul 13, 2023

Preparing for payment, I think there should be a bonus here. Can you help me confirm @MonilBhavsar?

Also, @fedirjh can you please complete the checklist: #20931 (comment)

Thanks!

@fedirjh fedirjh mentioned this issue Jul 14, 2023
57 tasks
@fedirjh
Copy link
Contributor

fedirjh commented Jul 14, 2023


Regression Test Proposal

  1. Login with phone number login
  2. Navigate to settings
  3. Navigate to share code screen
  4. Observe the subtitle on QR view
  5. Verify the number show without the @expensify.sms suffix.

Do we agree 👍 or 👎

@alexpensify
Copy link
Contributor

Alright, @dhairyasenjaliya and @fedirjh, I've prepared the payments via Upwork. Please confirm you received it and I can close this GH out after I create the regression test. Thank you!

@fedirjh
Copy link
Contributor

fedirjh commented Jul 14, 2023

@alexpensify Thank you! received.

@dhairyasenjaliya
Copy link
Contributor

@alexpensify received thank you

@alexpensify
Copy link
Contributor

Thank you and great work! I've closed the job in Upwork, created the regression test, and am going to close this GH now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants