Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.34k stars 2.77k forks source link

[HOLD for payment 2023-06-21] [$1000] 'Link sent!' message is not dynamically updated when changing language preference #18827

Closed kavimuru closed 1 year ago

kavimuru commented 1 year ago

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. Add a secondary login account, and leave it unverified
  2. Open new tab
  3. Navigate to sign in page
  4. Enter the unverified email address
  5. Click on Unlink button
  6. Verify that 'Link sent!' message is displayed
  7. Scroll down, and select Spanish as a language preference

Expected Result:

'Link sent!' message should be dynamically updated to Spanish

Actual Result:

'Link sent!' message is not dynamically updated to Spanish

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

Version Number: 1.3.13.1 Reproducible in staging?: y Reproducible in production?: y 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

https://github.com/Expensify/App/assets/43996225/2f37361c-60f6-4de9-8b6c-a1e93a3b3b99

Expensify/Expensify Issue URL: Issue reported by: @natnael-guchima Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683649359591549

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0198d8720bb9bfb004
  • Upwork Job ID: 1659222928961388544
  • Last Price Increase: 2023-05-18
melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

Pujan92 commented 1 year ago

Proposal

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

Link sent isn't changed dynamically on language change

What is the root cause of that problem?

In the onyx success message we are storing the translated message so it won't get updated on language change. https://github.com/Expensify/App/blob/6d27757667e0757d02a390623c072c69238c7070/src/libs/actions/Session/index.js#L713

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

We should store the translation key in the onyx successData message instead of the translated value and In the component, we need to use this translation key to get the value which makes the text language specific.

https://github.com/Expensify/App/blob/6d27757667e0757d02a390623c072c69238c7070/src/pages/signin/UnlinkLoginForm.js#L65-L69

props.translate(props.account.message)
eh2077 commented 1 year ago

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

'Link sent!' message is not dynamically updated when changing language preference.

What is the root cause of that problem?

The root cause is that we translate link sent success message here

https://github.com/Expensify/App/blob/6d27757667e0757d02a390623c072c69238c7070/src/libs/actions/Session/index.js#L713

in the success data, which will not be translated into local language here

https://github.com/Expensify/App/blob/6d27757667e0757d02a390623c072c69238c7070/src/pages/signin/UnlinkLoginForm.js#L68

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

To fix this issue, we should not translate link sent success message in the success data here

https://github.com/Expensify/App/blob/6d27757667e0757d02a390623c072c69238c7070/src/libs/actions/Session/index.js#L713

but set message code like

message: 'unlinkLoginForm.linkSent'

And then translate here

https://github.com/Expensify/App/blob/6d27757667e0757d02a390623c072c69238c7070/src/pages/signin/UnlinkLoginForm.js#L68

We can fix similar issues in file https://github.com/Expensify/App/blob/6d27757667e0757d02a390623c072c69238c7070/src/libs/actions/Session/index.js or even other places

What alternative solutions did you explore? (Optional)

N/A

kevinksullivan commented 1 year ago

Discussing in slack

https://expensify.slack.com/archives/C049HHMV9SM/p1683937177713499?thread_ts=1683649359.591549&cid=C049HHMV9SM

melvin-bot[bot] commented 1 year ago

@kevinksullivan Whoops! This issue is 2 days overdue. Let's get this updated quick!

kevinksullivan commented 1 year ago

Ok, got the go ahead yesterday on moving this forward in that slack thread above.

melvin-bot[bot] commented 1 year ago

Job added to Upwork: https://www.upwork.com/jobs/~0198d8720bb9bfb004

melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @sophiepintoraetz (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

Natnael-Guchima commented 1 year ago

Ok, got the go ahead yesterday on moving this forward in that slack thread above.

@kevinksullivan if this is something that can be fixed, it might be a good idea to fix this issue too here - with a single PR. The issue I have referenced here has the same nature as the one that is being fixed here.

kevinksullivan commented 1 year ago

I am OOO for several days so I'm going to unassign this to make sure it still gets attention

melvin-bot[bot] commented 1 year ago

Current assignee @sophiepintoraetz is eligible for the Bug assigner, not assigning anyone new.

eh2077 commented 1 year ago

I'm willing to fix similar issues together as I mentioned in proposal cc @parasharrajat @cristipaval

parasharrajat commented 1 year ago

Reviewing now...

parasharrajat commented 1 year ago

Thanks, @Natnael-Guchima for bringing this up. We should definitely club those together. I noticed that are a couple of places where we can adopt the same translationKey logic. We should be doing this to all of those places.

That said, I looked over the other reported issue and it seems the same proposal solves both issues indirectly.

@Pujan92 is the first to come up with the approach so I am going with their proposal.

Note: As part of this issue, @Pujan92 Can you update each place where Onyx.ACCOUNT.message is used to use translationKey unless the message is coming from the backend?

cc: @cristipaval

:ribbon: :eyes: :ribbon: C+ reviewed

Pujan92 commented 1 year ago

Sure @parasharrajat. I will update each occurrence of the same.

melvin-bot[bot] commented 1 year ago

πŸ“£ @Pujan92 You have been assigned to this job by @cristipaval! Please apply to this job in Upwork 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 πŸ“–

sophiepintoraetz commented 1 year ago

Unfortunately, I am going OOO so won't be able to get to this. @kevinksullivan - seeing as you were the OG assignee, I'm reassigning you as we should be holding onto GHs as per this SO.

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

sophiepintoraetz commented 1 year ago

@michaelhaxhiu - you're just baby sitting this until kevin is back in office!

kevinksullivan commented 1 year ago

Offers sent in upwork @parasharrajat @Pujan92

parasharrajat commented 1 year ago

@Pujan92 Are you going to send a PR for this? It is already been 5 days.

Pujan92 commented 1 year ago

Sorry for the delay @parasharrajat , just raised a PR.

melvin-bot[bot] commented 1 year ago

@Pujan92, @cristipaval, @kevinksullivan, @parasharrajat Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

parasharrajat commented 1 year ago

Will be reviewed asap. Was sick the last 3 days and not fully active today as well.

melvin-bot[bot] commented 1 year ago

@Pujan92, @cristipaval, @kevinksullivan, @parasharrajat Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

kevinksullivan commented 1 year ago

@parasharrajat wanted to check in on this since it's been a bit (hope you're feeling better!). I see some comments from 3 days ago. What's your ETA for finishing this out?

parasharrajat commented 1 year ago

Just doing that now.

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

If no regressions arise, payment will be issued on 2023-06-21. :confetti_ball:

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.

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

melvin-bot[bot] commented 1 year ago

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:

kevinksullivan commented 1 year ago

@Natnael-Guchima @parasharrajat @Pujan92 please accept the offer in Upwork when you get a chance. Thanks!

Natnael-Guchima commented 1 year ago

@kevinksullivan it seems you have sent me a $1000 offer for bug reporting bonus by accident

kevinksullivan commented 1 year ago

Thanks @Natnael-Guchima , I modified the amount on the offer.

kevinksullivan commented 1 year ago

@parasharrajat bump on accepting offer, and can you complete the checklist above before we pay this out?

Natnael-Guchima commented 1 year ago

You are welcome, @kevinksullivan πŸ™Œ. Accepted the offer, thanks.

cristipaval commented 1 year ago

bump @parasharrajat

parasharrajat commented 1 year ago

[@parasharrajat] The PR that introduced the bug has been identified. Link to the PR: https://github.com/Expensify/App/pull/15811

[@parasharrajat] 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: https://github.com/Expensify/App/pull/15811/files#r1242598881 [@parasharrajat] 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: https://expensify.slack.com/archives/C049HHMV9SM/p1687804792012139

[@parasharrajat] Determine if we should create a regression test for this bug. Yes

[@parasharrajat] 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. https://github.com/Expensify/App/issues/18827#issuecomment-1608036607

parasharrajat commented 1 year ago

Regression Test Steps

  1. For user A go to Settings -> Profile -> Contact Method -> New contact method
  2. Add a new contact method called B
  3. Don't verify the method and logout.
  4. Open the login page in new tab.
  5. Enter unverified id B & click continue.
  6. Click on Unlink button.
  7. Verify the success message Link Sent is shown.
  8. Change the language from the language switch dropdown at the footer of the page. Verify that link sent message changes dynamically on changing the language.

Do you agree πŸ‘ or πŸ‘Ž ?

kevinksullivan commented 1 year ago

Paid out. Thanks everyone!