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 2024-10-10] [$250] Bank Account - "Please provide a valid email" error is not dismissed when navigating back #49129

Closed
3 of 6 tasks
IuliiaHerets opened this issue Sep 12, 2024 · 39 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

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 12, 2024

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


Version Number: v9.0.33-1
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Log in to an account
  2. Create a workspace > Enable Workflow > Connect bank account > Connect online with plaid
  3. continues the flow until you reached "Company website" page
  4. Click on "Next" button with out entering an email. Notice error is shown.
  5. Navigate back to "Tax" > Click next. Notice "Please provide a valid email" is shown
  6. Navigate back

Expected Result:

"Please provide a valid email" error is not shown

Actual Result:

"Please provide a valid email" error is shown even after navigating back to other pages.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6601153_1726153889912.12.09.2024_17.40.24_REC.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021838748303382636901
  • Upwork Job ID: 1838748303382636901
  • Last Price Increase: 2024-09-25
  • Automatic offers:
    • allgandalf | Reviewer | 104202965
Issue OwnerCurrent Issue Owner: @anmurali
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 12, 2024
Copy link

melvin-bot bot commented Sep 12, 2024

Triggered auto assignment to @anmurali (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@IuliiaHerets
Copy link
Author

@anmurali FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@gijoe0295
Copy link
Contributor

gijoe0295 commented Sep 12, 2024

Edited by proposal-police: This proposal was edited at 2024-09-12 19:20:18 UTC.

Proposal

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

The OP is incorrect. Should be Please provide a valid website error.

"Please provide a valid website" error is shown even after navigating back to other pages.

What is the root cause of that problem?

Offending PR: #48731

We save the defaultCompanyWebsite here as draft:

useEffect(() => {
BankAccounts.addBusinessWebsiteForDraft(defaultCompanyWebsite);
}, [defaultCompanyWebsite]);

But the default value might either be a website prefix placeholder https:// or a public domain website:

function getDefaultCompanyWebsite(session: OnyxEntry<OnyxTypes.Session>, user: OnyxEntry<OnyxTypes.User>): string {
return user?.isFromPublicDomain ? 'https://' : `https://www.${Str.extractEmailDomain(session?.email ?? '')}`;
}

If https:// is saved to the form draft, we would call the UpdateCompanyInformationForBankAccount with website: "https://" attribute and the BE would return the Please provide a valid Website error which keeps showing in all the sub-steps because it is a form error.

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

https:// should not be saved as draft because it's just an input placeholder value.

We should early return in the above effects if defaultCompanyWebsite === 'https://'.

@melvin-bot melvin-bot bot added the Overdue label Sep 16, 2024
Copy link

melvin-bot bot commented Sep 16, 2024

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

@gijoe0295
Copy link
Contributor

@anmurali Can you check this?

Copy link

melvin-bot bot commented Sep 18, 2024

@anmurali Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Sep 20, 2024

@anmurali 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

Copy link

melvin-bot bot commented Sep 24, 2024

@anmurali 10 days overdue. I'm getting more depressed than Marvin.

@anmurali anmurali added the External Added to denote the issue can be worked on by a contributor label Sep 25, 2024
@melvin-bot melvin-bot bot changed the title Bank Account - "Please provide a valid email" error is not dismissed when navigating back [$250] Bank Account - "Please provide a valid email" error is not dismissed when navigating back Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2024
Copy link

melvin-bot bot commented Sep 26, 2024

@anmurali @allgandalf this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@twilight2294
Copy link
Contributor

Proposal

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

https:// is saved as draft value for which the backend throws error.

What is the root cause of that problem?



When we open the website page for the first time we call a useEffect inside which the function addBusinessWebsiteForDraft is called:

useEffect(() => {
BankAccounts.addBusinessWebsiteForDraft(defaultCompanyWebsite);
}, [defaultCompanyWebsite]);

The default value for a public domain is https:// defined here.

Now Everytime we go back and click on save for any page, we call UpdateCompanyInformationForBankAccount which sends the saves onyx value and as https:// is not allowed on the backend, we always get ever as stated above.

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

The useEffect introduced in #48731 is not necessary, when we open the page, we shouldn't call useEffect and save the url directly. instead we should only save the values as a draft when we click on next button for the website page. i.e. we should call BankAccounts.addBusinessWebsiteForDraft(defaultCompanyWebsite) in the handleSubmit function here.

This way first we validate if the entered website is correctly formatted in our validate function here and then only call addBusinessWebsiteForDraft this makes sure that we do not call the function unnecessarily.

Also the default value shouldn't get affected because we set it directly here

The updated code would be (We will remove useEffect completely as that is not required here):

--- a/src/pages/ReimbursementAccount/BusinessInfo/substeps/WebsiteBusiness.tsx
+++ b/src/pages/ReimbursementAccount/BusinessInfo/substeps/WebsiteBusiness.tsx
@@ -55,13 +55,15 @@ function WebsiteBusiness({reimbursementAccount, user, session, onNext, isEditing
     );
     const handleSubmit = useReimbursementAccountStepFormSubmit({
         fieldIds: STEP_FIELDS,
-        onNext,
+        onNext: (values) => {
+
+
+            BankAccounts.addBusinessWebsiteForDraft(values?.website);
+            onNext();
+        },
         shouldSaveDraft: isEditing,
     });
 
-    useEffect(() => {
-        BankAccounts.addBusinessWebsiteForDraft(defaultCompanyWebsite);
-    }, [defaultCompanyWebsite]);
 
     return (
         <FormProvider

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Sep 30, 2024
Copy link

melvin-bot bot commented Sep 30, 2024

@anmurali, @allgandalf Huh... This is 4 days overdue. Who can take care of this?

@allgandalf
Copy link
Contributor

Thanks for the proposals everyone! 🙏

♻️ @gijoe0295 and @twilight294 both of you have pointed out the correct RCA , we save https:// as a draft value when we open the company website page using the useEffect.

  • For this Issue, we should go with @twilight294's solution here, because this way we make sure that we only save the draft value to onyx when we click save and we also don't have to use useEffect here.

So, lets go with @twilight294's proposal here

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 30, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 30, 2024
@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Oct 3, 2024
@melvin-bot melvin-bot bot changed the title [$250] Bank Account - "Please provide a valid email" error is not dismissed when navigating back [HOLD for payment 2024-10-10] [$250] Bank Account - "Please provide a valid email" error is not dismissed when navigating back Oct 3, 2024
Copy link

melvin-bot bot commented Oct 3, 2024

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

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Oct 3, 2024

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:

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

@mallenexpensify
Copy link
Contributor

@allgandalf
Copy link
Contributor

That bug was for private domains and there was no way as such to test during PR phase because we are on public domain, so i request to not count it for this specific issue:))

@allgandalf
Copy link
Contributor

Regression Test Proposal

  1. Log in to an public domain account

  2. Create a workspace > Enable Workflow > Connect bank account > Connect online with plaid

  3. continues the flow until you reached "Company website" page

  4. Click on "Next" button without entering an website. Notice error is shown.

  5. Navigate back to "Tax" > Click next.

    • Verify that: "Please provide a valid website" error is not shown

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 9, 2024
@twilight2294
Copy link
Contributor

Can someone please pay me out, the payment was supposed to happen yesterday, my upwork is : https://www.upwork.com/freelancers/~01047e1bc60ea55d80

@melvin-bot melvin-bot bot added the Overdue label Oct 11, 2024
@mallenexpensify
Copy link
Contributor

mallenexpensify commented Oct 12, 2024

Contributor: @twilight294 paid $250 via Upwork
Contributor+: @allgandalf paid $250 via Upwork.

Apologies for the delay @twilight294 , can you please apply for the job, then we'll hire and pay?
https://www.upwork.com/jobs/~021844895880907146867

Thx

@twilight2294
Copy link
Contributor

Apologies for the delay @twilight294 , can you please apply for the job, then we'll hire and pay?
https://www.upwork.com/jobs/~021844895880907146867

Sorry, I don't have enough connects on upwork to apply, is there a way to hire me directly @mallenexpensify ?
my upwork is: https://www.upwork.com/freelancers/~01047e1bc60ea55d80

@twilight2294
Copy link
Contributor

hello @mallenexpensify , reminder since it was weekend last time i texted ^

Copy link

melvin-bot bot commented Oct 14, 2024

@anmurali, @blimpich, @allgandalf, @twilight294 Huh... This is 4 days overdue. Who can take care of this?

@allgandalf
Copy link
Contributor

Not overdue sir melvin! 🙇

@twilight2294
Copy link
Contributor

hello @mallenexpensify , can you please help me out with #49129 (comment)

@anmurali anmurali assigned mallenexpensify and unassigned anmurali Oct 16, 2024
@melvin-bot melvin-bot bot removed the Overdue label Oct 16, 2024
@mallenexpensify
Copy link
Contributor

Apologies @twilight294 , I just invited you to the job, can you accept then I'll pay?
In the 3+ years we've been working with Upwork, I haven't encountered the issue you're experiencing.

@twilight2294
Copy link
Contributor

Thanks for the invite @mallenexpensify , I don't know what is happening, but upwork never allocated me connects :

Screenshot 2024-10-16 at 9 30 25 PM

@mallenexpensify
Copy link
Contributor

I think it's hard for newer freelancers in Upwork. And, for working with us, once you've been hired for 1 job it's a LOT easier to find and hire you for future jobs. Can you please accept the job and reply here once you have?
https://www.upwork.com/jobs/~021844895880907146867

@twilight2294
Copy link
Contributor

I accepted the offer, thank you so much, Looking forward to working on more issues

@mallenexpensify
Copy link
Contributor

Thanks @twilight294 , you've been paid. Payment breakdown updated above too.

Test case created too

🚀

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
No open projects
Status: Done
Development

No branches or pull requests

7 participants