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

Routing number error does not drop you back into connect manually flow #5028

Closed
aldo-expensify opened this issue Sep 2, 2021 · 17 comments
Closed
Assignees

Comments

@aldo-expensify
Copy link
Contributor

aldo-expensify commented Sep 2, 2021

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


Action Performed:

  1. Navigate to /bank-account/
  2. Click "Connect manually"
  3. Input an invalid routing number, i.e. 12312312344
  4. Input any bank number, i.e. 123
  5. Click "Save & continue" button

Note: The incorrect behaviour only happens the first time we get the error, to replicate it again, reload the page.

Expected Result:

See the loading transition, show again the same form highlighting the error in the routing number

Actual Result:

After the backend validation fails, the user is taken back to the step before choosing "Connect manually"

Screen.Recording.2021-09-22.at.11.57.57.AM.mov

Workaround:

The user can just click again "Connect manually" and proceed.

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

View all open jobs on GitHub

@aldo-expensify aldo-expensify added AutoAssignerTriage Auto assign issues for triage to an available triage team member Daily KSv2 labels Sep 2, 2021
@MelvinBot
Copy link

Triggered auto assignment to @CortneyOfstad (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@MelvinBot MelvinBot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Sep 2, 2021
@aldo-expensify aldo-expensify changed the title Account number error does not drop you back into connect manually flow Routing number error does not drop you back into connect manually flow Sep 2, 2021
@CortneyOfstad CortneyOfstad removed their assignment Sep 3, 2021
@MelvinBot
Copy link

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

@Luke9389
Copy link
Contributor

Luke9389 commented Sep 3, 2021

I agree with the Daily label here. I'm working on a separate N6 feature (design doc) so I'm gonna drop this so someone else can pick it up.

@Luke9389 Luke9389 removed their assignment Sep 3, 2021
@MelvinBot
Copy link

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

@MelvinBot
Copy link

Huh... This is 4 days overdue. Who can take care of this?

@aldo-expensify aldo-expensify self-assigned this Sep 9, 2021
@aldo-expensify
Copy link
Contributor Author

I'll work on this.

@marcaaron
Copy link
Contributor

This worked fine before. Was there a regression somewhere?

@aldo-expensify
Copy link
Contributor Author

This worked fine before. Was there a regression somewhere?

investigating...

@aldo-expensify
Copy link
Contributor Author

@marcaaron I think you are right, I tested version 1.0.75-11 and it seems to work fine:

Screen.Recording.2021-09-10.at.12.58.37.PM.mov

NOTE: 1.0.75-11 is not the most recent version where this was working!

@aldo-expensify
Copy link
Contributor Author

aldo-expensify commented Sep 10, 2021

It was a regression caused by this code:

https://github.com/Expensify/App/blob/main/src/libs/actions/BankAccounts.js#L648-L657

This was introduced in this PR

Basically it causes the BankAccountStep component to be created before we update the withdrawal account data here. At this point achData is equal to {subStep: 'manual'}, which in the past made it work.

When we create the component BankAccountStep before that last update, subStep in Onyx is null when it gets copied in the constructor.

Reverting this change to:

    API.BankAccount_SetupWithdrawal(newACHData)
        .then((response) => {
            Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {loading: false, achData: {...newACHData}});

Fixes the problem with the bug bouncing the user back to the previous view, and the bug described here doesn't seem to be happening anymore. Maybe it got fix some other way? fixed in Onyx? fixed by constantly saving the draft values? 🤷

How would we prefer to proceed?

  1. Revert as I'm pointing out here
  2. Use my PR about reading the subStep directly form Onyx always?
  3. Both

I would choose both, because I don't see any value in the complexity introduced here anymore, so I would revert that. I also still suggest reading the subStep directly from Onyx and avoid double fetching.

But if we wanted to go with the simplest solution, it would be just reverting!

@marcaaron
Copy link
Contributor

Thanks for looking into that 🙇

I agree we should still make subStep the single source of truth as you've called out. That seems like a better solution long term to me.

Looked at the code you mention, but I'm not too familiar with why those changes were made. Maybe we can get @Jag96 to weigh in before proceeding?

@Jag96
Copy link
Contributor

Jag96 commented Sep 10, 2021

@aldo-expensify I think you hit the nail on the head w/ the investigation.

The reason for that change was to fix an issue where Onyx.merge was overwriting data unexpectedly, more info here. The changes in that PR were to enable us to save previously entered account/routing numbers (issue), but most of that functionality was replaced by #5114 recently.

If you revert the code in question and you can successfully pass the tests from #5114 and #4477 then I think it's ok to revert.

@aldo-expensify
Copy link
Contributor Author

Thanks @Jag96 , I'll revert that part and test that everything is working fine then!

@aldo-expensify
Copy link
Contributor Author

I'll pick up this later today (no overdue)

@MelvinBot MelvinBot removed the Overdue label Sep 13, 2021
@aldo-expensify
Copy link
Contributor Author

No overdue, PR waiting for review

@MelvinBot MelvinBot added Overdue and removed Overdue labels Sep 15, 2021
@aldo-expensify
Copy link
Contributor Author

Updated PR with main - resolve conflicts

@MelvinBot MelvinBot added Overdue and removed Overdue labels Sep 20, 2021
@MelvinBot
Copy link

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

@botify botify closed this as completed Sep 23, 2021
@MelvinBot MelvinBot removed the Overdue label Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants