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
[WAITING ON CHECKLIST] [$250] Expensify Card - Expensify Card in system message is linked after deactivating it and visiting member profile #68123
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review
When opening a member profile from the workspace member list, the API returns the Expensify card, even if it is in a deactivated state. Currently, we do not have any logic to filter or check for the card’s state before displaying the system message:
As a result, system messages is linked deactive card
What changes do you think we should make in order to solve the problem?
We can check the card’s state and only show the linked card if the card is active. For example, I use logic similar to the filterInactiveCards function; however, in this case, we can only check for the STATE_DEACTIVATED state
This approach can be similarly applied to allUserCards.
Use a selector to filter inactive cards
This could be done using a selector in OnyxListItemProvider, but since this hook uses global and there may be future cases where we need access to inactive cards, it might not be ideal to filter here.
We could use useOnyx with the filterInactiveCards selector instead of relying on the global Onyx provider. However, we recently changed this logic to use useWorkspaceCardList. So this approach may no longer be ideal.
changed the title [-]Expensify Card - Expensify Card in system message is linked after deactivating it and visiting member profile[/-][+][$250] Expensify Card - Expensify Card in system message is linked after deactivating it and visiting member profile[/+]on Aug 8, 2025
The link logic only checks if the card object exists ( !!expensifyCard or !!companyCard), but doesn't check the card's state to see if it's deactivated.
Currently, when opening a member profile from the workspace member list, it returns cards including the inactive ones. Thus, it causes the link is highlighted again
What changes do you think we should make in order to solve the problem?
Create a helper function to check if a card is in an active state and should have clickable links
functionisCardActiveForLinks(card?: Card): boolean{if(!card){returnfalse;}// Use the same logic as filterInactiveCards - exclude closed, deactivated, and suspended cardsconst inactiveStates =[CONST.EXPENSIFY_CARD.STATE.CLOSED,CONST.EXPENSIFY_CARD.STATE.STATE_DEACTIVATED,CONST.EXPENSIFY_CARD.STATE.STATE_SUSPENDED];return!inactiveStates.includes(card.state);}
Update to use isCardActiveForLinks to decide whether we should show or not
We have 2 similar issues related to Expensify Card and Company Card. So we have to update both of them
Note: Looks like the ProposalPolice closed my proposal by mistake. I believe my proposal is differ with the existing one since it cover both cases company card and expensify card
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Add test for isCardActiveForLinks
What alternative solutions did you explore? (Optional)
NA 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.
⚠️@lorretheboy Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
⚠️@lorretheboy Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
changed the title [-][Due for payment 2025-09-30] [$250] Expensify Card - Expensify Card in system message is linked after deactivating it and visiting member profile[/-][+][WAITING ON CHECKLIST] [$250] Expensify Card - Expensify Card in system message is linked after deactivating it and visiting member profile[/+]on Oct 1, 2025
[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: N/a
[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.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review
Activity
melvin-bot commentedon Aug 7, 2025
Triggered auto assignment to @jliexpensify (
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.linhvovan29546 commentedon Aug 8, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-08-08 05:21:04 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expensify Card - Expensify Card in system message is linked after deactivating it and visiting member profile
What is the root cause of that problem?
We display a system message in the following locations:
App/src/components/ReportActionItem/IssueCardMessage.tsx
Line 28 in 0754dfc
App/src/components/ReportActionItem/IssueCardMessage.tsx
Line 36 in 0754dfc
App/src/hooks/useGetExpensifyCardFromReportAction.ts
Line 19 in 0754dfc
When opening a member profile from the workspace member list, the API returns the Expensify card, even if it is in a deactivated state. Currently, we do not have any logic to filter or check for the card’s state before displaying the system message:
App/src/libs/ReportActionsUtils.ts
Lines 2872 to 2873 in 0754dfc
As a result, system messages is linked deactive card
What changes do you think we should make in order to solve the problem?
We can check the card’s state and only show the linked card if the card is active. For example, I use logic similar to the filterInactiveCards function; however, in this case, we can only check for the STATE_DEACTIVATED state
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can write the test for getCardIssuedMessage
What alternative solutions did you explore? (Optional)
App/src/hooks/useGetExpensifyCardFromReportAction.ts
Line 12 in 0754dfc
This approach can be similarly applied to allUserCards.
This could be done using a selector in
OnyxListItemProvider, but since this hook uses global and there may be future cases where we need access to inactive cards, it might not be ideal to filter here.App/src/components/OnyxListItemProvider.tsx
Lines 18 to 19 in 0754dfc
useOnyxwith thefilterInactiveCardsselector instead of relying on the globalOnyxprovider. However, we recently changed this logic to useuseWorkspaceCardList. So this approach may no longer be ideal.[-]Expensify Card - Expensify Card in system message is linked after deactivating it and visiting member profile[/-][+][$250] Expensify Card - Expensify Card in system message is linked after deactivating it and visiting member profile[/+]melvin-bot commentedon Aug 8, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021953686024813367308
melvin-bot commentedon Aug 8, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (
External)lorretheboy commentedon Aug 8, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expensify Card - Expensify Card in system message is linked after deactivating it and visiting member profile
What is the root cause of that problem?
The getCardIssuedMessage function determines whether to show a link based on the presence of the expensifyCard or companyCard objects
App/src/libs/ReportActionsUtils.ts
Line 2850 in 66b512d
The link logic only checks if the card object exists ( !!expensifyCard or !!companyCard), but doesn't check the card's state to see if it's deactivated.
App/src/libs/ReportActionsUtils.ts
Lines 2872 to 2873 in 66b512d
App/src/libs/ReportActionsUtils.ts
Lines 2875 to 2878 in 66b512d
Currently, when opening a member profile from the workspace member list, it returns cards including the inactive ones. Thus, it causes the link is highlighted again
What changes do you think we should make in order to solve the problem?
Create a helper function to check if a card is in an active state and should have clickable links
Update to use
isCardActiveForLinksto decide whether we should show or notWe have 2 similar issues related to Expensify Card and Company Card. So we have to update both of them
App/src/libs/ReportActionsUtils.ts
Lines 2872 to 2873 in 66b512d
App/src/libs/ReportActionsUtils.ts
Lines 2875 to 2878 in 66b512d
Note: Looks like the ProposalPolice closed my proposal by mistake. I believe my proposal is differ with the existing one since it cover both cases company card and expensify card
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Add test for
isCardActiveForLinksWhat alternative solutions did you explore? (Optional)
NA
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.
github-actions commentedon Aug 8, 2025
lorretheboy commentedon Aug 8, 2025
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
github-actions commentedon Aug 8, 2025
28 remaining items
jliexpensify commentedon Sep 28, 2025
Bump @getusha for the checklist please!
jliexpensify commentedon Oct 1, 2025
Bump @getusha for the checklist please
jliexpensify commentedon Oct 1, 2025
Payment Summary
NEW UPWORKS JOB: https://www.upwork.com/jobs/~021973196541751083764
linhvovan29546 commentedon Oct 1, 2025
@jliexpensify I've accepted
jliexpensify commentedon Oct 1, 2025
Paid and job closed, just waiting on checklist
[-][Due for payment 2025-09-30] [$250] Expensify Card - Expensify Card in system message is linked after deactivating it and visiting member profile[/-][+][WAITING ON CHECKLIST] [$250] Expensify Card - Expensify Card in system message is linked after deactivating it and visiting member profile[/+]getusha commentedon Oct 2, 2025
BugZero Checklist:
[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: https://github.com/Expensify/App/pull/55510/files#r2398184043
[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: N/a
[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.
We have a test case for this! https://test-management.browserstack.com/projects/2219752/test-runs/TR-111/folder/13176890/41237386/827407657?sort=%2Bidentifier
jliexpensify commentedon Oct 2, 2025
Thanks!
flaviadefaria commentedon Oct 2, 2025
$250 approved for @getusha