Skip to content

[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

Closed

Description

@m-natarajan

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


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:

  1. Use Expensify Card and trigger potential fraudulent transaction flag
  2. Clear the flag via New Expensify chat
  3. Click on Home tab
  4. Click on Review potential fraud alert under Time Sensitive Tasks
  5. 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:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

The screenshots for the issue is in Slack thread

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022035056909398145693
  • Upwork Job ID: 2035056909398145693
  • Last Price Increase: 2026-03-20

Activity

  1. added
    Daily
    Bug
    on Mar 20, 2026
  2. MelvinBot commented on Mar 20, 2026

    @MelvinBot
    Contributor

    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 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):

    1. 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
    2. In the failure data, restore the original card.fraud and card.nameValuePairs.possibleFraud values so the widget reappears if the API call fails
    3. 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.

  3. added
    External
    on Mar 20, 2026
  4. added
    Help Wanted
    on Mar 20, 2026
  5. melvin-bot commented on Mar 20, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @Krishna2323 (External)

  6. 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
  7. melvin-bot commented on Mar 20, 2026

    @melvin-bot
  8. NirDiamant commented on Mar 20, 2026

    @NirDiamant

    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:

    • 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.

  9. melvin-bot commented on Mar 20, 2026

    @melvin-bot

    📣 @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:

    1. Make sure you've read and understood the contributing guidelines.
    2. 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.
    3. 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.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  10. arlo-owls commented on Mar 20, 2026

    @arlo-owls

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  11. github-actions commented on Mar 20, 2026

    @github-actions
    Contributor

    ⚠️ @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.

  12. surafeal-dev commented on Mar 20, 2026

    @surafeal-dev

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  13. 56 remaining items

  14. added
    Daily
    Awaiting Payment
    on May 17, 2026
  15. melvin-bot commented on May 17, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  16. melvin-bot commented on May 18, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/2035056909398145693/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  17. mallenexpensify commented on May 19, 2026

    @mallenexpensify
    Contributor

    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

    Contributor details
    Your Expensify account email: email@email.com
    Upwork Profile Link: upwork.com/freelancers/~xxxxx

    ^ Test case created. Thx

  18. Uzaifm127 commented on May 20, 2026

    @Uzaifm127
    Contributor

    @mallenexpensify Accepted the offer and requested for the payment.

  19. Uzaifm127 commented on May 20, 2026

    @Uzaifm127
    Contributor

    Contributor details
    Your Expensify account email: uzaifm127@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/~01390840e678237ef1

  20. melvin-bot commented on May 20, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  21. mallenexpensify commented on May 20, 2026

    @mallenexpensify
    Contributor

    @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.

  22. laurenreidexpensify commented on Jun 29, 2026

    @laurenreidexpensify
    Contributor

    $250 approved for @Krishna2323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions