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 2025-02-05] [$250] Expensify Card - App uses data from other workspace when assigning card in different workspace #55125
Version Number: 9.0.84-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: Exp Email or phone of affected tester (no customers):applausetester+110106kh@applause.expensifail.com Issue reported by: Applause Internal Team Device used: Mac 15.0 / Chrome App Component: Workspace Settings
Action Performed:
Precondition:
Account has two workspaces.
Both workspaces have enabled Expensify Card.
Both workspaces have different members.
Go to staging.new.expensify.com
Go to workspace settings of the first workspace > Expensify Card.
Click Issue card.
Select the workspace member in the first step.
Reach the confirmation page.
Exit the flow by clicking outside RHP.
Go to workspace settings of the second workspace > Expensify Card.
Click Issue card.
Click Issue card on confirmation page.
Enter magic code.
Expected Result:
In Step 8, the card assignment flow should start from the beginning because it is a different workspace.
Actual Result:
In Step 8, the card assignment flow continues with data from the first workspace when admin assigns card on the second workspace.
Member from the first workspace appears on confirmation page.
When entering correct magic code, it shows error.
Please re-state the problem that we are trying to solve in this issue.
App uses data from other workspace when assigning card in different workspace
What is the root cause of that problem?
We use ISSUE_NEW_EXPENSIFY_CARD to get the data for issue card flow, There is no way currently to know if the data is for that unique policy, This causes the data in ISSUE_NEW_EXPENSIFY_CARD to persist amongst all policies.
What changes do you think we should make in order to solve the problem?
We need to make ISSUE_NEW_EXPENSIFY_CARD a Onyx collection and then store the value for each Policy.
This is only a template implementation details will be done during PR phase. Note that we need to update the places where we used to store ISSUE_NEW_EXPENSIFY_CARD data and clear it as well.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A but if we want we can write tests which clear the onyx data using clearIssueNewCardFlow and match if that policyID data is cleared
What alternative solutions did you explore? (Optional)
changed the title [-]Expensify Card - App uses data from other workspace when assigning card in different workspace[/-][+][$250] Expensify Card - App uses data from other workspace when assigning card in different workspace[/+]on Jan 15, 2025
changed the title [-][$250] Expensify Card - App uses data from other workspace when assigning card in different workspace[/-][+][HOLD for payment 2025-02-05] [$250] Expensify Card - App uses data from other workspace when assigning card in different workspace[/+]on Jan 29, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.90-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@brunovjk@laurenreidexpensify@brunovjk 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]
1a. Result of the original design (eg. a case wasn't considered)
1b. Mistake during implementation
1c. Backend bug
1z. Other:
Where bug was reported:
2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
2b. Reported on staging (eg. found during regression or PR testing)
2d. Reported on a PR
2z. Other:
Who reported the bug:
3a. Expensify user
3b. Expensify employee
3c. Contributor
3d. QA
3z. Other: Applause Internal Team
[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: No PR directly created this bug.
[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:
[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:
Account has two workspaces.
Both workspaces have enabled Expensify Card.
Both workspaces have different members.
Test:
App > Go to workspace settings of the first workspace > Expensify Card.
Click Issue card. > Select the workspace member in the first step > Reach the confirmation page.
Exit the flow by clicking outside RHP.
Go to workspace settings of the second workspace > Expensify Card.
Click Issue card.
Verify that: The card assignment flow should start from the beginning because it is a different workspace.
Activity
melvin-bot commentedon Jan 11, 2025
Triggered auto assignment to @laurenreidexpensify (
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.twilight2294 commentedon Jan 12, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
App uses data from other workspace when assigning card in different workspace
What is the root cause of that problem?
We use
ISSUE_NEW_EXPENSIFY_CARDto get the data for issue card flow, There is no way currently to know if the data is for that unique policy, This causes the data inISSUE_NEW_EXPENSIFY_CARDto persist amongst all policies.What changes do you think we should make in order to solve the problem?
We need to make
ISSUE_NEW_EXPENSIFY_CARDaOnyx collectionand then store the value for eachPolicy.First update the key here to:
This will help us in storing the data for each unique
policyID, Then remove the onyx assignment here and instead make it a collection:Then we for all the places we access this data, we need to update it to store/clear that particular
policyID's card data.And for the original bug in the OP, we need to update the following code:
App/src/pages/workspace/expensifyCard/issueNew/IssueNewCardPage.tsx
Lines 24 to 29 in fb487a5
To access for unique
policyID:This is only a template implementation details will be done during PR phase. Note that we need to update the places where we used to store
ISSUE_NEW_EXPENSIFY_CARDdata and clear it as well.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A but if we want we can write tests which clear the onyx data using
clearIssueNewCardFlowand match if that policyID data is clearedWhat alternative solutions did you explore? (Optional)
twilight2294 commentedon Jan 15, 2025
@laurenreidexpensify can you make this one external please 😄
melvin-bot commentedon Jan 15, 2025
@laurenreidexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Jan 15, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021879481800916724750
[-]Expensify Card - App uses data from other workspace when assigning card in different workspace[/-][+][$250] Expensify Card - App uses data from other workspace when assigning card in different workspace[/+]28 remaining items
[-][$250] Expensify Card - App uses data from other workspace when assigning card in different workspace[/-][+][HOLD for payment 2025-02-05] [$250] Expensify Card - App uses data from other workspace when assigning card in different workspace[/+]melvin-bot commentedon Jan 29, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jan 29, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.90-6 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-02-05. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jan 29, 2025
@brunovjk @laurenreidexpensify @brunovjk 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]
brunovjk commentedon Jan 31, 2025
I will complete the checklist the day before payday :D
brunovjk commentedon Feb 4, 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: No PR directly created this bug.
[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:
[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:
Test:
Do we agree 👍 or 👎
laurenreidexpensify commentedon Feb 5, 2025
Payment summary