You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-11-09] [$500] Wallet - Once after login, debit card page exits without open #30024
changed the title [-]Wallet - Once after login, debit card page exits without open[/-][+][$500] Wallet - Once after login, debit card page exits without open[/+]on Oct 19, 2023
And in the second useEffect the state of the previous and current setupComplete plays a very important role
When we open this screen for the first time we update the onyx state using the first useEffect what we call PaymentMethods.continueSetup() ahead of time
As a result, the ref we are using is not ready yet
And we call this part
if (!kycWallRef.current?.continue) {
Navigation.goBack(fallbackRoute);
return;
}
That means when user first logging in, kycWallRef was never ready because it was not rendered yet. Later when user entered AddDebitCardPage, a fallback will be called because kycWallRef was not ready, hence !kycWallRef.current?.continue will be true. That's the RCA.
What changes do you think we should make in order to solve the problem?
consthasWalletPer=Permissions.canUseWallet(betas);// or just !hasWalletPer && !hasBankAccount && !hasAssignedCard;constshouldShowEmptyState=!hasWalletPer&&!hasBankAccount&&!hasWallet&&!hasAssignedCard;
What alternative solutions did you explore? (Optional)
Please re-state the problem that we are trying to solve in this issue.
First time opening a debit card page navigates back
What is the root cause of that problem?
It is not reproducible in prod and might be a deploy blocker.
Seems a regression from #29074 where value for the setupComplete sets to true here in clearDebitCardFormErrorAndSubmit.
Bcoz of that change this !props.formData.setupComplete will be false and will not return from the below part.
Additionally, we can move this cleanup function to correct useEffect block as that will be called on unmount. Currently, it is called each time the dependency updates.
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.94-2 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 2023-11-09. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
External issue reporter
Contributor that fixed the issue
Contributor+ that helped on the issue and/or PR
For reference, here are some details about the assignees on this issue:
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:
[@parasharrajat] 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: Looks like a mistake that was not caught during testing.
[@parasharrajat] Determine if we should create a regression test for this bug.
[@parasharrajat] 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.
[@joekaufmanexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: N/A
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:
[@parasharrajat] 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: Looks like a mistake that was not caught during testing.
[@parasharrajat] Determine if we should create a regression test for this bug. yes
[@parasharrajat] 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.
Regression Test Steps
Logout if logged-in already and then login into the app.
Refresh/reload/restart the app based on the platform.
Goto Settings -> Wallet
Click on Add bank account -> Select debit card option
Verify the screen shows the debit card page properly and doesn't navigate back or refresh on load.
I am not really convinced we need a regression test for this. When I was triaging this originally, it was actually challenging to do this unless you really knew what to look for. So I don't think this is really worth testing every time. Especially given this was only reproducible the first time after signing in.
Activity
[-]Wallet - Once after login, debit card page exits without open[/-][+][$500] Wallet - Once after login, debit card page exits without open[/+]melvin-bot commentedon Oct 19, 2023
Triggered auto assignment to @joekaufmanexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 19, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01c55ad3e6cb6401c8
melvin-bot commentedon Oct 19, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Oct 19, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (
External)ZhenjaHorbach commentedon Oct 19, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Wallet - Once after login, debit card page exits without open
What is the root cause of that problem?
The problem is related to the order of actions in
DebitCardPagecomponentWe have two useEffect's
App/src/pages/settings/Wallet/AddDebitCardPage.js
Lines 48 to 62 in 79845f9
And in the second useEffect the state of the previous and current setupComplete plays a very important role
When we open this screen for the first time we update the onyx state using the first useEffect what we call
PaymentMethods.continueSetup()ahead of timeAs a result, the ref we are using is not ready yet
And we call this part
And just go back
App/src/libs/actions/PaymentMethods.ts
Lines 25 to 34 in 79845f9
What changes do you think we should make in order to solve the problem?
This problem related to this migrate
0f0ef68
Judging by the code, we don’t need clearDebitCardFormErrorAndSubmit when opening the screen
For this, we call clearDebitCardFormErrorAndSubmit during unmounting
App/src/pages/settings/Wallet/AddDebitCardPage.js
Lines 59 to 61 in 79845f9
So I think we can remove the first useEffect because I'm not sure it's needed
But if we are not sure in umounting screen
We can also add useEffect which calls when we blur the screen
Or
We can update useEffect which calls only during unmount
But since we have a call to this function during unmount in another useEffect
It looks unnecessary
What alternative solutions did you explore? (Optional)
We can update second useEffect like
To be sure that kycWallRef.current?.continue is ready
hungvu193 commentedon Oct 20, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Once after login, debit card page exits right after opening at start.
What is the root cause of that problem?
We only render the KYCWall which included the
kycWallRefwhen userhasWallet:App/src/pages/settings/Wallet/WalletPage/WalletPage.js
Lines 336 to 361 in 732d48e
That means when user first logging in,
kycWallRefwas never ready because it was not rendered yet. Later when user enteredAddDebitCardPage, a fallback will be called becausekycWallRefwas not ready, hence!kycWallRef.current?.continuewill be true. That's the RCA.What changes do you think we should make in order to solve the problem?
In the past, we will render WalletSection when user has wallet betas here (https://github.com/Expensify/App/pull/26406/files#diff-186ee6dd4f2074460e09890d51b9ef7ef11bc902c32e472b58b76a060a3e4d63)
However after migrating we decided to only render it when user already had wallet linked.
I think we should only show the empty state when user doesn't have bank account and assigned card, because we already implemented the
Enable Walletlogic for user.To do that we should update the
shouldShowEmptyStateofWalletPageto:What alternative solutions did you explore? (Optional)
N/A
Pujan92 commentedon Oct 20, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
First time opening a debit card page navigates back
What is the root cause of that problem?
It is not reproducible in prod and might be a deploy blocker.
Seems a regression from #29074 where value for the
setupCompletesets to true here inclearDebitCardFormErrorAndSubmit.Bcoz of that change this
!props.formData.setupCompletewill be false and will not return from the below part.App/src/pages/settings/Wallet/AddDebitCardPage.js
Lines 52 to 55 in 69cf29e
What changes do you think we should make in order to solve the problem?
We need to make the value for the
setupCompleteto false inclearDebitCardFormErrorAndSubmitas that is the default value for it.App/src/libs/actions/PaymentMethods.ts
Lines 213 to 217 in 69cf29e
Additionally, we can move this cleanup function to correct useEffect block as that will be called on unmount. Currently, it is called each time the dependency updates.
App/src/pages/settings/Wallet/AddDebitCardPage.js
Lines 59 to 62 in 69cf29e
App/src/pages/settings/Wallet/AddDebitCardPage.js
Lines 48 to 50 in 69cf29e
37 remaining items
melvin-bot commentedon Nov 2, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.94-2 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 2023-11-09. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Nov 2, 2023
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:
joekaufmanexpensify commentedon Nov 6, 2023
@parasharrajat could you take care of BZ checklist this week so we can prep to issue payments? TY!
parasharrajat commentedon Nov 6, 2023
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:
Regression Test Steps
Do you agree 👍 or 👎 ?
joekaufmanexpensify commentedon Nov 8, 2023
I am not really convinced we need a regression test for this. When I was triaging this originally, it was actually challenging to do this unless you really knew what to look for. So I don't think this is really worth testing every time. Especially given this was only reproducible the first time after signing in.
joekaufmanexpensify commentedon Nov 8, 2023
All set to issue payment, as follows:
joekaufmanexpensify commentedon Nov 8, 2023
@parasharrajat could you please request $500 via NewDot and comment here once complete?
joekaufmanexpensify commentedon Nov 9, 2023
@dhanashree-sawant $50 sent and contract ended!
joekaufmanexpensify commentedon Nov 9, 2023
@Pujan92 $500 sent and contract ended!
joekaufmanexpensify commentedon Nov 9, 2023
Closing as this is all set. All that's left is to pay out @parasharrajat's $500 request. Payment summary message is here.
parasharrajat commentedon Dec 5, 2023
Payment requested as per #30024 (comment)
JmillsExpensify commentedon Dec 11, 2023
$500 payment approved for @parasharrajat based on this comment.