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-08-08] Dev: Web - Console log error when trying to unlink secondary contact method #22923

Closed
1 of 6 tasks
kbecciv opened this issue Jul 14, 2023 · 20 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Jul 14, 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. Open a tab where account A is signed-in
  2. Add secondary contact method B, and do not verify that contact method
  3. Open a new window > Navigate to sign-in page
  4. Enter secondary contact method B & click on the continue button

Expected Result:

There shouldn't be any console log error

Actual Result:

Console log error displayed (ailed prop type: The prop welcomeText is marked as required in SignInPageContent, but its value is undefined.)

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: Dev 1.3.40-5
Reproducible in staging?: n/a
Reproducible in production?: n/a
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

Screencast.from.2023-07-14.15-18-03.mp4

Expensify/Expensify Issue URL:
Issue reported by: React JS Developer | Software QA Analyst | GH: @Natnael-Guchima
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689337434182419

View all open jobs on GitHub

@kbecciv kbecciv added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 14, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 14, 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

@c3024
Copy link
Contributor

c3024 commented Jul 15, 2023

Proposal

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

Console warning appears when the unlinking page appears after we login with a secondary login

What is the root cause of that problem?

We are not sending welcomeText in case of shouldShowUnlinkLoginForm here though it is a required prop.
https://github.com/Expensify/App/blob/b9508b616f3a7229365c8bd7280fd1e34cfd2f9b/src/pages/signin/SignInPage.js#L155C5-L162C5

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

We should add

welcomeText = isSmallScreenWidth ? translate('welcomeText.welcomeBack') : '';

below the welcomeHeader in the above specified code snippet in RCA there similar to the else statement in the shouldShowResendValidationForm below it.

What alternative solutions did you explore? (Optional)

Since, we are showing Welcome Back as welcomeHeader on large screen on the unlinking page as shouldShowWelcomeHeader is true if isUnvalidatedLogin is true
https://github.com/Expensify/App/blob/b9508b616f3a7229365c8bd7280fd1e34cfd2f9b/src/pages/signin/SignInPage.js#L82C5-L83C1
, we would like to show Welcome Back as welcomeText as well in case of smaller screens but shouldShowWelcomeText does not include isUnvalidatedLogin in its check here
https://github.com/Expensify/App/blob/b9508b616f3a7229365c8bd7280fd1e34cfd2f9b/src/pages/signin/SignInPage.js#L83C5-L84C1
and it returns false.
So we should change the
shouldShowWelcomeText also in line with shouldShowWelcomeHeader like this

const shouldShowWelcomeText = shouldShowLoginForm || shouldShowPasswordForm || shouldShowValidateCodeForm || isUnvalidatedSecondaryLogin || shouldShowEmailDeliveryFailurePage;

Since, we are setting welcomeText to '' explicitly here,
https://github.com/Expensify/App/blob/b9508b616f3a7229365c8bd7280fd1e34cfd2f9b/src/pages/signin/SignInPage.js#L159C1-L161C10
adding shouldShowEmailDelieryFailurePage in the above line has no unexpected effect.

@dukenv0307
Copy link
Contributor

Proposal

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

A console error appears when trying to unlink the secondary contact method

What is the root cause of that problem?

When we login with the secondary contact method that is not verified, shouldShowUnlinkLoginForm is true and shouldShowEmailDeliveryFailurePage is false. That makes welcomeText isn't set for this case

} else if (shouldShowUnlinkLoginForm || shouldShowEmailDeliveryFailurePage) {
welcomeHeader = isSmallScreenWidth ? translate('login.hero.header') : translate('welcomeText.welcomeBack');
// Don't show any welcome text if we're showing the user the email delivery failed view
if (shouldShowEmailDeliveryFailurePage) {
welcomeText = '';
}
} else if (!shouldShowResendValidationForm) {

and because we don't set fault value for welcomeText, welcomeText is undefined for this case.

let welcomeHeader;
let welcomeText;

While welcomeText is required in SignInPageLayout. So console error appears

welcomeText={welcomeText}

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

We should set default value for welcomeText and welcomeHeader here to verify that welcomeHeader and welcomeText aren't undefined for all case

let welcomeHeader = '';
let welcomeText = '';

} else if (shouldShowUnlinkLoginForm || shouldShowEmailDeliveryFailurePage) {
welcomeHeader = isSmallScreenWidth ? translate('login.hero.header') : translate('welcomeText.welcomeBack');
// Don't show any welcome text if we're showing the user the email delivery failed view
if (shouldShowEmailDeliveryFailurePage) {
welcomeText = '';
}
} else if (!shouldShowResendValidationForm) {

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Jul 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 18, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 18, 2023

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

@sophiepintoraetz
Copy link
Contributor

Hey @MonilBhavsar - assigning you to help with reproducing the console error - as it's in a DEV environment.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jul 18, 2023
@sophiepintoraetz
Copy link
Contributor

Bump for @MonilBhavsar

@melvin-bot melvin-bot bot removed the Overdue label Jul 24, 2023
@MonilBhavsar
Copy link
Contributor

Sorry, I'm able to reproduce the issue. Looking if it's a regression, so we can ask author to fix it.

@MonilBhavsar MonilBhavsar removed the Needs Reproduction Reproducible steps needed label Jul 24, 2023
@MonilBhavsar
Copy link
Contributor

Commented on the PR. Looks like we missed this during Migration from class component to functional component, and is a minor change. Would just push a quick fix and request review from author.

@sophiepintoraetz
Copy link
Contributor

Reporting offer sent - only payment due here seeing as Monil took the fix internally 🙏

@Natnael-Guchima
Copy link

Accepted the offer. Thank you.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 Weekly KSv2 labels Jul 28, 2023
@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Aug 1, 2023
@melvin-bot melvin-bot bot changed the title Dev: Web - Console log error when trying to unlink secondary contact method [HOLD for payment 2023-08-08] Dev: Web - Console log error when trying to unlink secondary contact method Aug 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 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 Aug 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

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

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 Aug 1, 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:

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

@sophiepintoraetz
Copy link
Contributor

Payments done!

@0xmiros
Copy link
Contributor

0xmiros commented Aug 23, 2023

@sophiepintoraetz sorry for late. C+ payment is pending here

@MonilBhavsar MonilBhavsar reopened this Aug 23, 2023
@MonilBhavsar
Copy link
Contributor

MonilBhavsar commented Aug 23, 2023

Reopening to pay c+
0miroslav reviewed PR, so we need to pay them

@sophiepintoraetz
Copy link
Contributor

I see that we have an internal discussion on the best way to pay @0xmiroslav - given that we cannot pay another account

@sophiepintoraetz
Copy link
Contributor

Discussed internally that we cannot pay another account other than to @0xmiroslav - I've sent an offer here!

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

No branches or pull requests

7 participants