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-09-04] Security - notFound.goBackHome message appears after disabling 2FA authentication #25674

Closed
6 tasks done
lanitochka17 opened this issue Aug 22, 2023 · 33 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 22, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Issue found when executing PR #23060

Action Performed:

Precondition: Have 2FA set up.

  1. Launch New Expensify app.
  2. Go to Settings > Security > Two-factor authentication.
  3. Tap Disable two-factor authentication.

Expected Result:

There is no error message

Actual Result:

notFound.goBackHome message appears after disabling 2FA authentication
This error message also appears in different page in apps, like the map in Distance tab when going offline

Workaround:

Unknown

Platforms:

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

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

Version Number: 1.3.56-2

Reproducible in staging?: Yes

Reproducible in production?: No

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

Bug6173011_Screen_Recording_20230822_102533_New_Expensify.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Aug 22, 2023
@OSBotify
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@melvin-bot
Copy link

melvin-bot bot commented Aug 22, 2023

Triggered auto assignment to @Julesssss (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@aimane-chnaif
Copy link
Contributor

Regression from #25164

@allroundexperts
Copy link
Contributor

I think this is not a regression. The above mentioned PR just made this visible.

@allroundexperts
Copy link
Contributor

allroundexperts commented Aug 22, 2023

Proposal

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

notFound.goBackHome is not translated.

What is the root cause of that problem?

The real issue here is that here, we're specifying a default link of value notFound.goBackHome but we're never translating it

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

We should change this line to:

link: ''

Inside the component, we can destructure link as originalLink and add the following line:

const link = originalLink ?? localize.translate('notFound.goBackHome');

What alternative solutions did you explore? (Optional)

None

@melvin-bot melvin-bot bot added Daily KSv2 and removed Hourly KSv2 labels Aug 22, 2023
@narefyev91
Copy link
Contributor

The real issue here is that here, we're specifying a default link of value notFound.goBackHome but we're never translating it. We should change the above mentioned line to:

Localize.translate(`notFound.goBackHome`)

Agree with @allroundexperts

@Pujan92
Copy link
Contributor

Pujan92 commented Aug 22, 2023

Proposal

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

Default link not gets trnaslated

What is the root cause of that problem?

When we pass shouldShowLink and default link is not we are translating that is the issue.

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

Remove translation from FullPageNotFoundView by passing only key and apply translation only in the BlockingView

link={props.translate(props.linkKey)}

@daordonez11
Copy link
Contributor

This was fixed in #25516 I agree with @allroundexperts it's better to fix in case the default link is used.

@Pujan92
Copy link
Contributor

Pujan92 commented Aug 22, 2023

@narefyev91 @allroundexperts how about passing plain linkKey from FullPageNotFoundView and apply single translation directly in the BlockingView as that is the component that we are using eventually #25674 (comment)?

@mountiny mountiny assigned mountiny and unassigned Julesssss Aug 22, 2023
@mountiny
Copy link
Contributor

@allroundexperts are you able to work on this right now?

@aimane-chnaif
Copy link
Contributor

@allroundexperts's proposal doesn't work. It will crash

@allroundexperts
Copy link
Contributor

Yes @mountiny I can create a PR now.

@allroundexperts
Copy link
Contributor

@aimane-chnaif The proposal was more of a general approach. I wasn't able to test it completely because of the short time. I'll test it in the PR.

@aimane-chnaif
Copy link
Contributor

We should either use useLocalize (@shubham1206agra's proposal) or pass key (@Pujan92's proposal).
It shouldn't be used in default prop.

@shubham1206agra
Copy link
Contributor

We should either use useLocalize (@shubham1206agra's proposal) or pass key (@Pujan92's proposal). It shouldn't be used in default prop.

Huh
My proposal went missing 😨

@shubham1206agra
Copy link
Contributor

Can I rewrite the same proposal again @aimane-chnaif

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 22, 2023
@Pujan92
Copy link
Contributor

Pujan92 commented Aug 22, 2023

We should either use useLocalize (@shubham1206agra's proposal)

I think this also won't work bcoz in some cases we are passing already translated links from FullPageNotFoundView and retranslating makes the crash. So better to pass keys only from the parent and apply translation in BlockingView

@shubham1206agra
Copy link
Contributor

Just change the link there

@allroundexperts
Copy link
Contributor

allroundexperts commented Aug 22, 2023

My proposal seems to work fine. @aimane-chnaif What issue did you saw?

Tested it with translateLocal method.

@aimane-chnaif
Copy link
Contributor

My proposal seems to work fine. @aimane-chnaif What issue did you saw?

Tested it with translateLocal method.

Is it dynamic? when change language on another device?

@mountiny
Copy link
Contributor

Alright so I have created pr to fix the issue with the linkKey but also this is irrelevant now as we are not showing the link because of this #25516

@mountiny
Copy link
Contributor

We dont need the link so I will CP this #25516 to staging to fix this issue

@shubham1206agra
Copy link
Contributor

Alright so I have created pr to fix the issue with the linkKey but also this is irrelevant now as we are not showing the link because of this #25516

Bruh

@allroundexperts
Copy link
Contributor

I think we should still fix this by either translating the default link or by removing the default link altogether.

@mountiny
Copy link
Contributor

Bruh

Yes

I think we should still fix this by either translating the default link or by removing the default link altogether.

Yes

@allroundexperts
Copy link
Contributor

allroundexperts commented Aug 22, 2023

Is it dynamic? when change language on another device?

It's not. But we can make it so by changing the defaultProp of link to '' and using the following inside the component:

const newLink = link ?? localize.translate('notFound.goBackHome');

Updated proposal.

@mountiny
Copy link
Contributor

@allroundexperts @shubham1206agra @aimane-chnaif @narefyev91 @daordonez11 Thanks for help here, really appreciate it. Deploy blockers are the highest urgency work you can focus on and because of that I have also taken over and created the PR myself. I understand you would prefer to land a job to get paid for here but we need to put the quick work here over that. I hope you can still help us with the most urgent tasks as it benefits the entire company which means more work for the community.

@narefyev91
Copy link
Contributor

@allroundexperts @shubham1206agra @aimane-chnaif @narefyev91 @daordonez11 Thanks for help here, really appreciate it. Deploy blockers are the highest urgency work you can focus on and because of that I have also taken over and created the PR myself. I understand you would prefer to land a job to get paid for here but we need to put the quick work here over that. I hope you can still help us with the most urgent tasks as it benefits the entire company which means more work for the community.

No worries at all!

@mountiny
Copy link
Contributor

@Pujan92 We will still merge the fix

@allroundexperts
Copy link
Contributor

All good @mountiny!

@mountiny mountiny removed the DeployBlockerCash This issue or pull request should block deployment label Aug 23, 2023
@mountiny
Copy link
Contributor

Fixed on staging

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 28, 2023
@melvin-bot melvin-bot bot changed the title Security - notFound.goBackHome message appears after disabling 2FA authentication [HOLD for payment 2023-09-04] Security - notFound.goBackHome message appears after disabling 2FA authentication Aug 28, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.57-6 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-09-04. 🎊

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

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 Engineering Weekly KSv2
Projects
None yet
Development

No branches or pull requests

10 participants