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-17] [$1000] Contact method - An error message is in English in Spanish account #21001

Closed
1 of 6 tasks
lanitochka17 opened this issue Jun 19, 2023 · 26 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

@lanitochka17
Copy link

lanitochka17 commented Jun 19, 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. Go to URL https://staging.new.expensify.com/
  2. Login with any account
  3. Go to Settings -> Preferences -> Language -> Change language to Spanish
  4. Go to Profile -> Contact method -> Open any unvalidated contact method
  5. Write a wrong magic code

Expected Result:

An error message is in Spanish

Actual Result:

An error message is in English

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.29.0

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

Bug6097924_1806

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0160ca5817cf9d9f89
  • Upwork Job ID: 1671872446268678144
  • Last Price Increase: 2023-06-29
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 19, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 19, 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

@hungvu193
Copy link
Contributor

Proposal

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

Contact method - An error message is in English in Spanish account

What is the root cause of that problem?

While validating secondary contact methods, we're displaying the error from server, but the server's returning message instead of phrase key, that's why even we changed the language, the error is still in English.
Screenshot 2023-06-19 at 10 33 53

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

From Frontend: Add translations key for the error from server, for example in this issue, we should add translation for invalid magic code.
From backend: Return error with the key phrase instead of english text.

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot melvin-bot bot added the Overdue label Jun 21, 2023
@muttmuure
Copy link
Contributor

image

@melvin-bot melvin-bot bot removed the Overdue label Jun 22, 2023
@muttmuure muttmuure added the External Added to denote the issue can be worked on by a contributor label Jun 22, 2023
@melvin-bot melvin-bot bot changed the title Contact method - An error message is in English in Spanish account [$1000] Contact method - An error message is in English in Spanish account Jun 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0160ca5817cf9d9f89

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

melvin-bot bot commented Jun 22, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Jun 26, 2023
@muttmuure
Copy link
Contributor

@hungvu193's proposal looks like a good start @mollfpr

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2023
@mollfpr
Copy link
Contributor

mollfpr commented Jun 27, 2023

I think it's not worth using BE changes here. We already have the phrase for validating error contacts.genericFailureMessages.validateSecondaryLogin, but it displays the error message from the server instead.

@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@hoangzinh
Copy link
Contributor

hoangzinh commented Jun 29, 2023

Proposal

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

Contact method - An error message is in English in Spanish account

What is the root cause of that problem?

  • When we're failed to validate secondary login, we get current timestamp before sending API, and set a translation phrase key to the errorFields:
    errorFields: {
    validateLogin: ErrorUtils.getMicroSecondOnyxError('contacts.genericFailureMessages.validateSecondaryLogin'),
    },

But BE also returns an error message too with timestamp at the time that BE validate magic code. That means error message of BE always has the timestamp greater than the timestamp of FE failureData

For example:
Screenshot 2023-06-29 at 23 36 15

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

I think we should select the first error message to show in this case. Because every time we call API to validate secondary login, we already cleared the errorFields and we have set an error message in the failureData in FE side so it makes sense if we should use it instead of BE error messages which usually contains either technical errors or English error messages.

In order to do it, we can make another function getFirstErrorField same as getLatestErrorField here, but it will get first. Then we use it to show in the Secondary login validation form here

Screenshot results

Screenshot 2023-06-29 at 23 55 38
Screenshot 2023-06-29 at 23 55 51

@mollfpr

This comment was marked as duplicate.

@mollfpr
Copy link
Contributor

mollfpr commented Jun 29, 2023

I agree with you @hoangzinh as I thought we could reuse the current phrase that we have.

Let's game on! The #21001 (comment) from @hoangzinh looks good to me 🚀

🎀 👀 🎀 C+ reviewed!

@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

Triggered auto assignment to @Beamanator, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

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

melvin-bot bot commented Jul 3, 2023

📣 @mollfpr 🎉 An offer has been automatically sent to your Upwork account 🎉

Reviewer - [$1000] Contact method - An error message is in English in Spanish account

@melvin-bot
Copy link

melvin-bot bot commented Jul 3, 2023

📣 @hoangzinh 🎉 An offer has been automatically sent to your Upwork account 🎉

Contributor - [$1000] Contact method - An error message is in English in Spanish account 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 📖

@Beamanator
Copy link
Contributor

Sorry for the delay, i was ooo last friday!

@melvin-bot melvin-bot bot removed the Overdue label Jul 3, 2023
@hoangzinh
Copy link
Contributor

hoangzinh commented Jul 3, 2023

Melvin, The PR will be ready for review within couple of hours. Btw, I haven't received the offer on Upwork yet

@hoangzinh
Copy link
Contributor

@mollfpr @Beamanator PR is ready #22100. Please help me review it. Thanks ❤️

@melvin-bot
Copy link

melvin-bot bot commented Jul 10, 2023

@Beamanator, @hoangzinh, @mollfpr, @muttmuure Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@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 10, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Contact method - An error message is in English in Spanish account [HOLD for payment 2023-07-17] [$1000] Contact method - An error message is in English in Spanish account Jul 10, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 10, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 10, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.38-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-17. 🎊

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 10, 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:

  • [@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
  • [@mollfpr] 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:
  • [@mollfpr] 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:
  • [@mollfpr] Determine if we should create a regression test for this bug.
  • [@mollfpr] 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.
  • [@muttmuure] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/301211

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jul 17, 2023
@mollfpr
Copy link
Contributor

mollfpr commented Jul 18, 2023

[@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
[@mollfpr] 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:

I can't make sure this, this might be related to an update in the BE.

[@mollfpr] 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:

The regression test should be enough.

[@mollfpr] Determine if we should create a regression test for this bug.
[@mollfpr] 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.

  1. Login with any account
  2. Go to Settings -> Preferences -> Language -> Change language to English
  3. Go to Profile -> Contact method -> Open any unvalidated contact method
  4. Fill-in incorrect magic codes
  5. Verify that it shows an invalid magic codes error in English
  6. Go to Settings -> Preferences -> Language -> Change language to Spanish
  7. Go to Profile -> Contact method -> Open previous unvalidated contact method in step 3
  8. Verify that it shows an invalid magic code error in Spanish
  9. 👍 or 👎

@melvin-bot melvin-bot bot removed the Overdue label Jul 18, 2023
@mollfpr
Copy link
Contributor

mollfpr commented Jul 18, 2023

Posting the calculation since Melvin forget about it

The issue assignment is on Jul 3, 2023, 6:52 PM GMT+8.

Screenshot 2023-07-18 at 11 58 41

PR merged is on Jul 6, 2023, 6:35 PM GMT+8.

Screenshot 2023-07-18 at 11 58 22

So, July 6, 2023, 6:35 PM GMT+8 is approximately 2.958 days after July 3, 2023, 6:52 PM GMT+8, which is nearly 3 days later.

This is still eligible for the bonus.

@melvin-bot melvin-bot bot added the Overdue label Jul 20, 2023
@muttmuure
Copy link
Contributor

Everybody got paid

@melvin-bot melvin-bot bot removed the Overdue label Jul 20, 2023
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

6 participants