-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Clear Personal Bank Account Onyx keys in componentWillUnmount #15679
Conversation
@puneetlath @Santhosh-Sellavel One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
if ((this.props.receivedRedirectURI && this.props.plaidLinkOAuthToken) | ||
|| !_.isEmpty(lodashGet(this.props.plaidData, 'bankAccounts')) | ||
|| !_.isEmpty(lodashGet(this.props.plaidData, 'errors'))) { | ||
|| !_.isEmpty(lodashGet(this.props.plaidData, 'errors')) | ||
|| !_.isEmpty(this.props.selectedPlaidAccountID)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm do you know why we're re-entering this view in the first place? I wonder if the fix shouldn't happen outside of the view so this component doesn't get called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the issue #15197 we are entering via deep-linking, directly using the URL so it makes sense.
But for another issue, I am confused too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm do you know why we're re-entering this view in the first place?
My theory is that when the user clicks the Continue
button on the PBA success page, because we clear ONYXKEYS.PERSONAL_BANK_ACCOUNT
, shouldShowSuccess evaluates to false and the AddPlaidBankAccount component is mounted again.
But I'm not 100% why it only happens during wallet KYC and via deep-linking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know what you think, @nkuoch @Santhosh-Sellavel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to clear details here?
App/src/pages/AddPersonalBankAccountPage.js
Lines 101 to 103 in 347a4f9
onButtonPress={() => { | |
BankAccounts.clearPersonalBankAccount(); | |
Navigation.navigate(ROUTES.SETTINGS_PAYMENTS); |
Does it affect anything else, if it needs to be cleared we can do it at componentWillUnmount
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I think we can remove BankAccounts.clearPersonalBankAccount();
from onButtonPress. The original idea was to make sure it's cleared for any next setup, but we already call it in componentDidMount, so it's probably useless here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, nice catch, @Santhosh-Sellavel! I think it would make sense to call it in componentWillUnmount
. We're also calling it at componentDidMount but maybe it makes more sense to just have it in componentWillUnmount
just so that there isn't any outdated data in the Onyx keys once the PBA is added. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree let me know when changes are done!
@MariaHCD I'll investigate this again, if no luck lets merge this tomorrow! |
if ((this.props.receivedRedirectURI && this.props.plaidLinkOAuthToken) | ||
|| !_.isEmpty(lodashGet(this.props.plaidData, 'bankAccounts')) | ||
|| !_.isEmpty(lodashGet(this.props.plaidData, 'errors'))) { | ||
|| !_.isEmpty(lodashGet(this.props.plaidData, 'errors')) | ||
|| !_.isEmpty(this.props.selectedPlaidAccountID)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to clear details here?
App/src/pages/AddPersonalBankAccountPage.js
Lines 101 to 103 in 347a4f9
onButtonPress={() => { | |
BankAccounts.clearPersonalBankAccount(); | |
Navigation.navigate(ROUTES.SETTINGS_PAYMENTS); |
Does it affect anything else, if it needs to be cleared we can do it at componentWillUnmount
Apologies for the delay here! Updated and re-tested! |
Reviewer Checklist
Screenshots/VideosWeb & Mobile Web - Chrome & Mobile Web - SafariUnable to test due CORS DesktopScreen.Recording.2023-03-20.at.1.42.39.AM.moviOS & AndroidScreen.Recording.2023-03-20.at.1.04.06.AM.mov |
Adding a PBA via Settings > Payments - ✅ Pass Adding a PBA via deep link -> Payments - ✅ Pass Adding a PBA via Sending Money -> Anyone tests this case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, test well!
Adding a PBA via Sending Money - Anyone tests this case alone thanks!
cc: @puneetlath or @nkuoch
Adding a PBA via Sending Money -> ✅ Pass |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/nkuoch in version: 1.2.88-0 🚀
|
🚀 Deployed to staging by https://github.com/nkuoch in version: 1.2.88-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.2.88-2 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.2.88-2 🚀
|
Context: #15202 (comment)
This change ensures that we don't re-trigger the Plaid process once the user adds their PBA
Details
Fixed Issues
$ #15202
$ #15197
PROPOSAL: GH_LINK_ISSUE(COMMENT)
Tests
Adding a PBA via Settings > Payments
Adding a PBA via Sending Money
Pay with Expensify
>Bank Account
Adding a PBA via deep link
Offline tests
Not applicable
QA Steps
Same as test steps except they should be performed on staging
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Via Settings > Payments
Screen.Recording.2023-03-06.at.5.59.28.PM.mov
Via sending money
Screen.Recording.2023-03-06.at.5.58.13.PM.mov
Via deep link
Screen.Recording.2023-03-06.at.6.11.46.PM.mov
Mobile Web - Chrome
Unable to test this platform as the redirect from Plaid leads to opening the native app
Mobile Web - Safari
Unable to test this platform as the redirect from Plaid leads to new.expensify.com
Desktop
Screen.Recording.2023-03-06.at.6.20.03.PM.mov
iOS
Screen.Recording.2023-03-06.at.6.25.20.PM.mov
Android
Screen.Recording.2023-03-06.at.6.52.56.PM.mov