Skip to content

[Due for payment 2025-03-31] [$250] Wallet - Check Box is unselected when changing Account Type #55688

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

Closed
1 of 8 tasks
lanitochka17 opened this issue Jan 23, 2025 · 25 comments
Closed
1 of 8 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Jan 23, 2025

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: 9.0.89-2
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: #54798
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Account settings > Wallet
  3. Click Add bank account
  4. Select any country other than US
  5. Enter info and reach confirmation page
  6. On confirmation page, Select the terms checkbox
  7. Click the account type selector row
  8. Change the account type and Confirm

Expected Result:

The checkbox should remain selected after changing account type

Actual Result:

The checkbox is unselected after changing account type

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6722248_1737672192939.Screen_Recording_2025-01-24_at_1.37.24_at_night.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021882570613169902798
  • Upwork Job ID: 1882570613169902798
  • Last Price Increase: 2025-01-30
  • Automatic offers:
    • dominictb | Reviewer | 106014247
    • mkzie2 | Contributor | 106014248
Issue OwnerCurrent Issue Owner: @MitchExpensify
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Jan 23, 2025
Copy link

melvin-bot bot commented Jan 23, 2025

Triggered auto assignment to @cead22 (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Jan 23, 2025

💬 A slack conversation has been started in #expensify-open-source

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.

@lanitochka17
Copy link
Author

Different behavior on prod (bank account flow)

bandicam.2025-01-24.02-13-31-549.mp4

@cead22 cead22 added Daily KSv2 External Added to denote the issue can be worked on by a contributor and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Jan 23, 2025
Copy link

melvin-bot bot commented Jan 23, 2025

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

@melvin-bot melvin-bot bot changed the title Wallet - Check Box is unselected when changing Account Type [$250] Wallet - Check Box is unselected when changing Account Type Jan 23, 2025
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 23, 2025
Copy link

melvin-bot bot commented Jan 23, 2025

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

@mkzie2
Copy link
Contributor

mkzie2 commented Jan 24, 2025

Proposal

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

The checkbox is unselected after changing account type

What is the root cause of that problem?

The confirmation step is unmounted when we go to the account type step. The account type step doesn't use FormProvider and when we merge the value we call setDraftValues which will merge the value to the draft form. While the value is merging, the confirmation step is rendered again, and in FormProvider, the draftValues is undefinfed the first time rendered (see the log below for more detail) then the acceptTerms is an empty string when we register the input.

setDraftValues(ONYXKEYS.FORMS.INTERNATIONAL_BANK_ACCOUNT_FORM, {[CONST.CORPAY_FIELDS.ACCOUNT_TYPE_KEY]: currentAccountType});

Image

The reason it's an empty string instead of false is because we don't pass the valueType to InputWrapper then it's initialized as an empty string by getInitialValueByType function

inputValues[inputID] = inputProps.defaultValue ?? getInitialValueByType(inputProps.valueType);

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

We have two options to fix this issue

  1. We should only call onNext until the merge value is completed. We can return a promise in setDraftValues function and call the onNext in this promise
function setDraftValues(formID: OnyxFormKey, draftValues: NullishDeep<OnyxValue<OnyxFormDraftKey>>) {
    return Onyx.merge(`${formID}Draft`, draftValues ?? null);
}

setDraftValues(ONYXKEYS.FORMS.INTERNATIONAL_BANK_ACCOUNT_FORM, {[CONST.CORPAY_FIELDS.ACCOUNT_TYPE_KEY]: currentAccountType}).then(() => {
    onNext();
});

setDraftValues(ONYXKEYS.FORMS.INTERNATIONAL_BANK_ACCOUNT_FORM, {[CONST.CORPAY_FIELDS.ACCOUNT_TYPE_KEY]: currentAccountType});

  1. Use FormProvider in AccountType step. That will require some migration. We can use the same way in TypeBusiness

Using defaultValue from formValues can work because formValues is passed from the InternationalDepositAccount that isn't unmounted in this flow. But I think it doesn't fix the RCA of this issue.

Optional: We can add valueType prop as boolean to the InputWrapper of the checkbox then this value can be initialized correctly.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

NA

What alternative solutions did you explore? (Optional)

NA

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

Copy link

melvin-bot bot commented Jan 27, 2025

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

@melvin-bot melvin-bot bot added the Overdue label Jan 27, 2025
Copy link

melvin-bot bot commented Jan 29, 2025

@cead22, @dominictb Eep! 4 days overdue now. Issues have feelings too...

@cead22
Copy link
Contributor

cead22 commented Jan 30, 2025

Waiting for proposal reviews

@melvin-bot melvin-bot bot removed the Overdue label Jan 30, 2025
Copy link

melvin-bot bot commented Jan 30, 2025

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

@dominictb
Copy link
Contributor

  1. Use FormProvider in AccountType step. That will require some migration. We can use the same way in TypeBusiness

@mkzie2 provided correct RCA. Let's go with this solution to follow our form convention.

LGTM 🎀👀🎀

Copy link

melvin-bot bot commented Feb 2, 2025

Current assignee @cead22 is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added Overdue and removed Help Wanted Apply this label when an issue is open to proposals by contributors labels Feb 5, 2025
Copy link

melvin-bot bot commented Feb 5, 2025

📣 @dominictb 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Feb 5, 2025

📣 @mkzie2 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
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 📖

Copy link

melvin-bot bot commented Feb 6, 2025

@cead22, @dominictb, @mkzie2 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 Overdue labels Feb 6, 2025
@mkzie2
Copy link
Contributor

mkzie2 commented Feb 6, 2025

@dominictb The PR is ready for review.

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Mar 4, 2025
Copy link

melvin-bot bot commented Mar 4, 2025

This issue has not been updated in over 15 days. @cead22, @dominictb, @mkzie2 eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@dominictb
Copy link
Contributor

PR is actively under review.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Monthly KSv2 labels Mar 24, 2025
@melvin-bot melvin-bot bot changed the title [$250] Wallet - Check Box is unselected when changing Account Type [Due for payment 2025-03-31] [$250] Wallet - Check Box is unselected when changing Account Type Mar 24, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 24, 2025
Copy link

melvin-bot bot commented Mar 24, 2025

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

Copy link

melvin-bot bot commented Mar 24, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.17-1 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 2025-03-31. 🎊

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

@dominictb
Copy link
Contributor

dominictb commented Mar 27, 2025

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: NA

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: NA

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue: https://github.com/Expensify/Expensify/issues/486931

Regression Test Proposal

Precondition:

  • Enable newDotInternationalDepositBankAccount beta

Test:

  1. Go to Account settings > Wallet
  2. Click Add bank account
  3. Select any country other than US
  4. Enter info and reach confirmation page
  5. Verify in account type step, the Confirm button shows at the bottom
  6. On confirmation page, Select the terms checkbox
  7. Click the account type selector row
  8. Verify in account type step, the Confirm button does NOT show at the bottom
  9. Change the account type
  10. Verify the terms checkbox remains selected

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 31, 2025
Copy link

melvin-bot bot commented Mar 31, 2025

Issue is ready for payment but no BZ is assigned. @MitchExpensify you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!

@MitchExpensify
Copy link
Contributor

Payment summary:

@MitchExpensify
Copy link
Contributor

Paid and contracts ended

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 Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

6 participants