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
[Due for payment 2025-05-14] [$250] Web - Expensify Card - Expensify Card page reloads after closing bank account setup RHP #58807
Version Number: 9.1.16-0 Reproducible in staging?: Y Reproducible in production?: Y 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: N/A Issue reported by: Applause - Internal Team
Action Performed:
Go to staging.new.expensify.com
Create a new workspace
Go to workspace settings > More features
Enable Expensify Card
Go to Expensify Card
Click Issue new card
Click Upgrade to USD if prompted
Click RHP back button or click outside the RHP
Expected Result:
Expensify Card page will not reload after closing bank account setup RHP. (The issue was previously fixed in this PR #48613
).
Actual Result:
Expensify Card page reloads after closing bank account setup RHP
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 evidenceBug6776895_1742479857654.20250320_220846.mp4
changed the title [-]Web - Expensify Card - Expensify Card page reloads after closing bank account setup RHP[/-][+][$250] Web - Expensify Card - Expensify Card page reloads after closing bank account setup RHP[/+]on Mar 21, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-03-27 15:09:05 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expensify Card page reloads after closing bank account setup RHP
What is the root cause of that problem?
When we close the RHP while cardsList is empty, cardSettings is also triggered to load by useFocusEffect, causing cardSettings.isLoading to become true, which results in the loading indicator appearing and leads to this issue.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
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.
"I don't think we need to fetch Expensify cards when the Connect bank account modal is closed, since nothing has changed. useFocusEffect(fetchExpensifyCards); is only triggered on navigation, I believe.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.40-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@rojiphil@maddylewis@rojiphil The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[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: Not Required. The existing checklist is good enough to capture such issues.
[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.
Regression Test Proposal
Precondition:
Enable Expensify Card for a workspace.
Test:
Navigate to Workspace settings -> Expensify Card
Click Issue new card (upgrade to USD if prompted)
Click RHP back button or click outside the RHP
Verify that Expensify Card page is not reloaded after closing the bank account setup
Activity
melvin-bot commentedon Mar 20, 2025
Triggered auto assignment to @maddylewis (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.nyomanjyotisa commentedon Mar 20, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-04-10 13:06:30 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expensify Card page reloads after closing bank account setup RHP
What is the root cause of that problem?
We use
useFocusEffectfor thefetchExpensifyCardswhich will execute thefetchExpensifyCardseverytime it refocusedWe remove the
&& !cardsListfrom theisLoadingcondition in this PR #56331App/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx
Line 40 in 1814bf4
So it make the
isLoadingtrue everytimecardFeeds.isLoadingis trueWhat changes do you think we should make in order to solve the problem?
Update to
useEffectto only execute thefetchExpensifyCardsevery rerender only, and make it consistent withWorkspaceCompanyCardPageApp/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx
Line 43 in 248f253
-1-New-Expensify.mp4
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
We should add
isEmptyObject(cardsList)to theisLoadingcondition like we did in Company Cards hereThis makes the behavior consistent both on Expensify Card & Company Cards. And we need this to prevent the spinner show everytime user opens the page
We should update to
useEffectto make it consistent withWorkspaceCompanyCardPageApp/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx
Line 43 in 248f253
[-]Web - Expensify Card - Expensify Card page reloads after closing bank account setup RHP[/-][+][$250] Web - Expensify Card - Expensify Card page reloads after closing bank account setup RHP[/+]melvin-bot commentedon Mar 21, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021903124259903434822
melvin-bot commentedon Mar 21, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rojiphil (
External)huult commentedon Mar 23, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-03-27 15:09:05 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expensify Card page reloads after closing bank account setup RHP
What is the root cause of that problem?
When we close the RHP while
cardsListis empty,cardSettingsis also triggered to load by useFocusEffect, causingcardSettings.isLoadingto becometrue, which results in the loading indicator appearing and leads to this issue.App/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx
Line 40 in 99f22dd
What changes do you think we should make in order to solve the problem?
To resolve this issue, we simply prevent calling openPolicyExpensifyCardsPage when cardsList is empty.
App/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx
Lines 31 to 33 in 99f22dd
update to:
const fetchExpensifyCards = useCallback(() => { if (isEmptyObject(cardsList)) { return; } openPolicyExpensifyCardsPage(policyID, workspaceAccountID); }, [cardsList, policyID, workspaceAccountID]);Screen.Recording.2025-03-23.at.23.47.25.mov
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
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.
"I don't think we need to fetch Expensify cards when the
Connect bank accountmodal is closed, since nothing has changed.useFocusEffect(fetchExpensifyCards);is only triggered on navigation, I believe.App/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx
Line 30 in 99f22dd
add
const [modal] = useOnyx(ONYXKEYS.MODAL); const modalWasVisibleRef = useRef(false); useEffect(() => { // Track if modal is or was recently visible if (!modal?.isVisible) { return; } modalWasVisibleRef.current = true; }, [modal?.isVisible]);App/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx
Lines 31 to 33 in 99f22dd
update to
const fetchExpensifyCards = useCallback(() => { if (modalWasVisibleRef.current) { modalWasVisibleRef.current = false; return; } openPolicyExpensifyCardsPage(policyID, workspaceAccountID); }, [policyID, workspaceAccountID]);melvin-bot commentedon Mar 25, 2025
@rojiphil Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Mar 27, 2025
@rojiphil Huh... This is 4 days overdue. Who can take care of this?
44 remaining items
melvin-bot commentedon May 7, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.40-7 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-05-14. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon May 7, 2025
@rojiphil @maddylewis @rojiphil The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
rojiphil commentedon May 13, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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:
[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: Not Required. The existing checklist is good enough to capture such issues.
[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.
Regression Test Proposal
Precondition:
Expensify Cardfor a workspace.Test:
Issue new card(upgrade to USD if prompted)Do we agree 👍 or 👎
rojiphil commentedon May 13, 2025
@maddylewis BZ checklist is done. Thanks.
maddylewis commentedon May 15, 2025
will issue payments today!
maddylewis commentedon May 15, 2025
Payment Overview + Final To-Dos
garrettmknight commentedon May 20, 2025
$250 approved for @rojiphil