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

[InternalQA] Prevent UI change on VBA flow during data fetch #4480

Merged
merged 5 commits into from
Aug 11, 2021

Conversation

luacmartins
Copy link
Contributor

Fixed Issues

$ #4467

Tests

  1. Create a new Workspace and
  2. Add an account in PENDING state following this SO.
  3. When you get to the step where the button changes to Finish Setup, close the modal.
  4. Click the button again and observe that it does not change back to Get Started while fetching.

QA Steps

Internal QA

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

web.mov

Mobile Web

Desktop

desktop.mov

iOS

Android

@luacmartins luacmartins self-assigned this Aug 6, 2021
@luacmartins luacmartins requested a review from a team August 9, 2021 16:31
@MelvinBot MelvinBot requested review from marcaaron and removed request for a team August 9, 2021 16:31
@luacmartins luacmartins marked this pull request as ready for review August 9, 2021 16:32
@luacmartins luacmartins requested a review from a team as a code owner August 9, 2021 16:32
@MelvinBot MelvinBot removed the request for review from a team August 9, 2021 16:32
@@ -330,7 +330,11 @@ function fetchUserWallet() {
function fetchFreePlanVerifiedBankAccount(stepToOpen) {
// We are using set here since we will rely on data from the server (not local data) to populate the VBA flow
// and determine which step to navigate to.
Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {loading: true});
// We temporarily keep the achData state to prevent UI changes while fetching.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if we do not do this? At what point is it getting overwritten?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also I think this comment should be placed above the line with achData

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The button text is updated when achData.state changes. So the UI changes when we set achData without the previous state. It is overwritten by setting achData.state = lodashGet(achData, 'state', ''); and then merging it here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is overwritten by setting achData.state = lodashGet(achData, 'state', '');

Hmm where does that happen? Sorry I'm not seeing it 🙃

Copy link
Contributor Author

@luacmartins luacmartins Aug 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem! Hopefully I can clarify it below:

We are passing achData with the new state to goToWithdrawalAccountSetupStep and then merging it here. Because ...achData is called after ...newACHData, we are overriding the value that was temporarily stored in newACHData.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just posted a semi-related issue in #4477 (comment), linking for context in case its the same issue

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jag96 Took a quick look, but not sure if they have the same "root cause" besides the local state is reset each time we fetch information about the bank account. One caveat to keep in mind is that we attempted to port this logic over from Web-Secure and retain the functionality we have there - but I'm sure there will be some edge cases to work through as the flows are not exactly the same.

src/libs/actions/BankAccounts.js Show resolved Hide resolved
Copy link
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gonna approve this since I can't come up with a better suggestion atm and we need to iron out the kinks in this flow. I do think we should create an issue to address future improvements to this flow.

We've run into a few UI bugs and error handling issues related to this stuff so it would be good to spend some time thinking about how to improve things and what the resulting pain points are - since we are likely to run into them again when migrating other code to the new architecture.

@luacmartins
Copy link
Contributor Author

I created a follow up issue. Feel free to add more context/details to it.

@luacmartins
Copy link
Contributor Author

Self-merging as discussed 1:1 with @marcaaron

@luacmartins luacmartins merged commit 6a14b42 into main Aug 11, 2021
@luacmartins luacmartins deleted the cmartins-setup-button branch August 11, 2021 16:26
@francoisl
Copy link
Contributor

Hi @luacmartins, any chance you can run the internal QA steps and check this PR off #4554 if it works please? Thanks!

@luacmartins
Copy link
Contributor Author

I confirmed the steps in staging!

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @isagoico in version: 1.0.85-9 🚀

platform result
🤖 android 🤖 failure ❌
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants