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 2026-05-18] [$250] Stale "Review fraudulent charge" task on the Home screen in New Expensify but the fraud flag was already cleared #85981
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 contributor
Version Number: Reproducible in staging?: Needs Reproduction (Reproduction blocked) Reproducible in production?: Needs Reproduction If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@strepanier03 Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Use Expensify Card and trigger potential fraudulent transaction flag
Clear the flag via New Expensify chat
Click on Home tab
Click on Review potential fraud alert under Time Sensitive Tasks
Get dropped into Inbox in workspace chat with nothing actionable seen
Expected Result:
Customer expects time sensitive task to be cleared when resolving fraud flag in chat and reactivating card
Actual Result:
The workspace chat shows the fraud flag was cleared and the card reactivated but the time-sensitive task to review the fraud is still visible on the Home tab.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
Please re-state the problem that we are trying to solve in this issue.
After a user clears a fraud flag on their Expensify Card via the New Expensify chat (clicking "It was me" on the fraud alert whisper), the card gets reactivated but the "Review potential fraud alert" time-sensitive task persists on the Home screen. Clicking this stale task drops the user into the workspace chat with nothing actionable.
What is the root cause of that problem?
The resolveFraudAlert() function in src/libs/actions/Card.ts:1562-1619 only makes optimistic Onyx updates to REPORT_ACTIONS (setting the resolution field on the chat whisper). It does not update CARD_LIST at all.
The Home screen's TimeSensitiveSection determines whether to show the fraud review widget by checking the card's Onyx state — specifically card.fraud and card.nameValuePairs.possibleFraud — via the useTimeSensitiveCards hook and the isCardWithPotentialFraud() utility.
Since resolveFraudAlert never touches CARD_LIST, the card retains its fraud = 'domain'/'individual' state and its possibleFraud data in Onyx after resolution. The chat whisper buttons disappear immediately (because the report action resolution IS optimistically updated), but the Home screen widget persists because it reads card state, not report action state.
What changes do you think we should make in order to solve the problem?
Add optimistic Onyx updates to CARD_LIST in the resolveFraudAlert() function at src/libs/actions/Card.ts, following the same pattern used by freezeCard()/unfreezeCard() (which use buildCardListUpdates() to optimistically update card state):
In the optimistic data, merge into the card's CARD_LIST entry: set card.fraud to CONST.EXPENSIFY_CARD.FRAUD_TYPES.NONE and clear card.nameValuePairs.possibleFraud to null
In the failure data, restore the original card.fraud and card.nameValuePairs.possibleFraud values so the widget reappears if the API call fails
The function signature may need to accept the card object (or workspaceAccountID) to use buildCardListUpdates(), similar to how freezeCard/unfreezeCard are structured
What alternative solutions did you explore? (Optional)
An alternative would be to have the useTimeSensitiveCards hook cross-check the report action's resolution status (i.e., look up the fraud alert report action and check if it already has a resolution set). However, this would add unnecessary coupling between the card widget and report actions data, and goes against the existing pattern where card UI state is driven by card Onyx data. The optimistic update approach is cleaner, consistent with other card actions (freezeCard, unfreezeCard), and provides immediate UI feedback.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
changed the title [-]Stale "Review fraudulent charge" task on the Home screen in New Expensify but the fraud flag was already cleared[/-][+][$250] Stale "Review fraudulent charge" task on the Home screen in New Expensify but the fraud flag was already cleared[/+]on Mar 20, 2026
Please re-state the problem that we are trying to solve in this issue.
After a user resolves a fraud alert on their Expensify Card by clicking "Confirm" (It was me) in the New Expensify workspace chat, the "Review potential fraud alert" time-sensitive task on the Home screen continues to be displayed even though the fraud has been cleared and the card reactivated.
What is the root cause of that problem?
The Home screen reads fraud state exclusively from ONYXKEYS.CARD_LIST via the useTimeSensitiveCards hook (src/pages/home/TimeSensitiveSection/hooks/useTimeSensitiveCards.ts:22), which shows the widget when isCardWithPotentialFraud(card) is true — i.e., when card.fraud === 'individual'/'domain' or card.nameValuePairs?.possibleFraud is populated (src/libs/CardUtils.ts:1178-1179).
The resolveFraudAlert function (src/libs/actions/Card.ts:1562-1619) only writes optimistic/success/failure data to ONYXKEYS.COLLECTION.REPORT_ACTIONS — it sets originalMessage.resolution on the chat whisper message. It never updates CARD_LIST. So after the user resolves the fraud alert in chat, the report action correctly shows resolution: 'recognized', but CARD_LIST still holds card.fraud = 'individual' and card.nameValuePairs.possibleFraud still populated. The Home screen hook only reads CARD_LIST and has no awareness of the report action's resolution, so it keeps showing the stale task until the backend eventually pushes an updated card object via Pusher.
What changes do you think we should make in order to solve the problem?
In resolveFraudAlert (src/libs/actions/Card.ts), add optimistic, success, and failure Onyx updates for ONYXKEYS.CARD_LIST alongside the existing REPORT_ACTIONS updates:
Optimistic data: For the given cardID, merge { fraud: CONST.EXPENSIFY_CARD.FRAUD_TYPES.NONE, nameValuePairs: { possibleFraud: null } } into the card entry in CARD_LIST. This makes the Home screen task disappear immediately when the user clicks "Confirm".
Success data: No additional change needed (backend will push the updated card).
Failure data: Revert CARD_LIST back to the original fraud value and possibleFraud object (captured before the API call) so the task re-appears if the API fails.
This should only apply when isFraud === false (the RECOGNIZED resolution path — user confirmed it was them). When isFraud === true (actual fraud), the card gets deactivated by the backend, so the Pusher-pushed update is the appropriate source of truth.
What alternative solutions did you explore?
An alternative would be to modify useTimeSensitiveCards to cross-reference ONYXKEYS.COLLECTION.REPORT_ACTIONS for each card's fraudAlertReportID and hide the widget if the action already has a resolution set. This avoids touching resolveFraudAlert but adds a joined Onyx query (two keys) to a hook that currently only needs one key, adding complexity and performance cost. The optimistic CARD_LIST update in resolveFraudAlert is simpler and more consistent with the existing pattern used elsewhere in the codebase.
📣 @NirDiamant! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
⚠️@arlo-owls 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.
Thanks for entering your contributor details, hopefully you'll get auto-offers in Upwork upon GH assignment in the future. If not, please tag me on the issue when it doesn't happen and I'll look into it.
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 contributor
Activity
MelvinBot commentedon Mar 20, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After a user clears a fraud flag on their Expensify Card via the New Expensify chat (clicking "It was me" on the fraud alert whisper), the card gets reactivated but the "Review potential fraud alert" time-sensitive task persists on the Home screen. Clicking this stale task drops the user into the workspace chat with nothing actionable.
What is the root cause of that problem?
The
resolveFraudAlert()function insrc/libs/actions/Card.ts:1562-1619only makes optimistic Onyx updates toREPORT_ACTIONS(setting theresolutionfield on the chat whisper). It does not updateCARD_LISTat all.The Home screen's
TimeSensitiveSectiondetermines whether to show the fraud review widget by checking the card's Onyx state — specificallycard.fraudandcard.nameValuePairs.possibleFraud— via theuseTimeSensitiveCardshook and theisCardWithPotentialFraud()utility.Since
resolveFraudAlertnever touchesCARD_LIST, the card retains itsfraud = 'domain'/'individual'state and itspossibleFrauddata in Onyx after resolution. The chat whisper buttons disappear immediately (because the report action resolution IS optimistically updated), but the Home screen widget persists because it reads card state, not report action state.What changes do you think we should make in order to solve the problem?
Add optimistic Onyx updates to
CARD_LISTin theresolveFraudAlert()function atsrc/libs/actions/Card.ts, following the same pattern used byfreezeCard()/unfreezeCard()(which usebuildCardListUpdates()to optimistically update card state):CARD_LISTentry: setcard.fraudtoCONST.EXPENSIFY_CARD.FRAUD_TYPES.NONEand clearcard.nameValuePairs.possibleFraudtonullcard.fraudandcard.nameValuePairs.possibleFraudvalues so the widget reappears if the API call failsworkspaceAccountID) to usebuildCardListUpdates(), similar to howfreezeCard/unfreezeCardare structuredWhat alternative solutions did you explore? (Optional)
An alternative would be to have the
useTimeSensitiveCardshook cross-check the report action's resolution status (i.e., look up the fraud alert report action and check if it already has aresolutionset). However, this would add unnecessary coupling between the card widget and report actions data, and goes against the existing pattern where card UI state is driven by card Onyx data. The optimistic update approach is cleaner, consistent with other card actions (freezeCard,unfreezeCard), and provides immediate UI feedback.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.melvin-bot commentedon Mar 20, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Krishna2323 (
External)[-]Stale "Review fraudulent charge" task on the Home screen in New Expensify but the fraud flag was already cleared[/-][+][$250] Stale "Review fraudulent charge" task on the Home screen in New Expensify but the fraud flag was already cleared[/+]melvin-bot commentedon Mar 20, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022035056909398145693
NirDiamant commentedon Mar 20, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After a user resolves a fraud alert on their Expensify Card by clicking "Confirm" (It was me) in the New Expensify workspace chat, the "Review potential fraud alert" time-sensitive task on the Home screen continues to be displayed even though the fraud has been cleared and the card reactivated.
What is the root cause of that problem?
The Home screen reads fraud state exclusively from ONYXKEYS.CARD_LIST via the useTimeSensitiveCards hook (src/pages/home/TimeSensitiveSection/hooks/useTimeSensitiveCards.ts:22), which shows the widget when isCardWithPotentialFraud(card) is true — i.e., when card.fraud === 'individual'/'domain' or card.nameValuePairs?.possibleFraud is populated (src/libs/CardUtils.ts:1178-1179).
The resolveFraudAlert function (src/libs/actions/Card.ts:1562-1619) only writes optimistic/success/failure data to ONYXKEYS.COLLECTION.REPORT_ACTIONS — it sets originalMessage.resolution on the chat whisper message. It never updates CARD_LIST. So after the user resolves the fraud alert in chat, the report action correctly shows resolution: 'recognized', but CARD_LIST still holds card.fraud = 'individual' and card.nameValuePairs.possibleFraud still populated. The Home screen hook only reads CARD_LIST and has no awareness of the report action's resolution, so it keeps showing the stale task until the backend eventually pushes an updated card object via Pusher.
What changes do you think we should make in order to solve the problem?
In resolveFraudAlert (src/libs/actions/Card.ts), add optimistic, success, and failure Onyx updates for ONYXKEYS.CARD_LIST alongside the existing REPORT_ACTIONS updates:
This should only apply when isFraud === false (the RECOGNIZED resolution path — user confirmed it was them). When isFraud === true (actual fraud), the card gets deactivated by the backend, so the Pusher-pushed update is the appropriate source of truth.
What alternative solutions did you explore?
An alternative would be to modify useTimeSensitiveCards to cross-reference ONYXKEYS.COLLECTION.REPORT_ACTIONS for each card's fraudAlertReportID and hide the widget if the action already has a resolution set. This avoids touching resolveFraudAlert but adds a joined Onyx query (two keys) to a hook that currently only needs one key, adding complexity and performance cost. The optimistic CARD_LIST update in resolveFraudAlert is simpler and more consistent with the existing pattern used elsewhere in the codebase.
melvin-bot commentedon Mar 20, 2026
📣 @NirDiamant! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
arlo-owls commentedon Mar 20, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
github-actions commentedon Mar 20, 2026
surafeal-dev commentedon Mar 20, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
56 remaining items
melvin-bot commentedon May 17, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon May 18, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon May 19, 2026
Payment Summary
Contributor: @Uzaifm127 paid $250 via Upwork
Contributor+: @Krishna2323 due $250 via NewDot
@Uzaifm127 can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022056869028992861136
@Uzaifm127 in a dedicated post, can you enter your Upwork details? I'm hoping they'll be saved to send you auto-offers in the future. Thx
^ Test case created. Thx
Uzaifm127 commentedon May 20, 2026
@mallenexpensify Accepted the offer and requested for the payment.
Uzaifm127 commentedon May 20, 2026
Contributor details
Your Expensify account email: uzaifm127@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01390840e678237ef1
melvin-bot commentedon May 20, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
mallenexpensify commentedon May 20, 2026
@Uzaifm127 paid, summary updated above. Thx.
Thanks for entering your contributor details, hopefully you'll get auto-offers in Upwork upon GH assignment in the future. If not, please tag me on the issue when it doesn't happen and I'll look into it.
laurenreidexpensify commentedon Jun 29, 2026
$250 approved for @Krishna2323