Skip to content

Agents - Import failed when columns are mapped correctly #95755

Closed

Description

@applause-bot

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: 9.4.32-1
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #95421
Email or phone of affected tester (no customers): sidbhisdhidhisdhis@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Other

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Account > Agents.
  3. Click New agent and add an agent.
  4. Click Copilot on agent row.
  5. Go to Account > Wallet.
  6. Click Import transactions.
  7. Click Card display name.
  8. Enter display name > Save > Next.
  9. Upload a valid file (attached below).
  10. Map Date column.
  11. Click Import.

Expected Result:

Transactions will be imported because columns are mapped correctly.

Actual Result:

Import failed when columns are mapped correctly.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7204051_1783620164022.9.1.mp4

Bug7204051_1783620164031!fake_transactions-2026-01-16.10_56_55.629.csv

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7204051

Issue OwnerCurrent Issue Owner: @NicolasBonet

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 9, 2026
  2. melvin-bot commented on Jul 9, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #95421

  3. melvin-bot commented on Jul 9, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Jul 9, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. MelvinBot commented on Jul 9, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    Root Cause (medium confidence): The "Import failed" modal shown here is not a column‑mapping problem — it fires after client validation passes, when the backend IMPORT_CSV_TRANSACTIONS write command rejects/throws (or the file yields zero valid rows). The App‑side import flow has no agent‑specific logic at all, so the blamed PR (#95421) did not change import behavior — it only restored Wallet visibility for agent accounts, which newly exposed the "Import transactions" flow to agents. The failure is almost certainly the backend refusing to create an imported card for an agent_*@expensify.ai account (agents aren't wallet/card holders server‑side).

    Why the title is misleading: With only the Date column mapped, you'd get an inline "Oops! A required field hasn't been mapped" error, never the "Import failed" modal (TransactionsImportedPage.tsx:75-91). The reported "Import failed" string only comes from the post‑validation path (ImportTransactions.ts:369-379), so the tester most likely did map all three required columns (date, merchant, amount) and the import failed downstream.

    Recommended resolution (deploy blocker): This needs an Expensify decision, not an App code fix for validation:

    1. If agents should NOT import their own CSV cards (most likely — PR Restore Wallet and other Account sections for agent accounts #95421's stated goal was only to let agents see assigned cards & transactions): re‑hide just the "Import transactions" entry point for agent accounts while keeping the rest of the Wallet visible. This is a small, App‑side change and unblocks the deploy without a full revert.
    2. If agents SHOULD be able to import: the fix is server‑side (Web‑Expensify/Auth IMPORT_CSV_TRANSACTIONS command must accept agent cardholders). That is outside the App repo — an internal engineer should investigate and confirm the backend rejection.
    Investigation details & evidence

    "Import failed" is a post‑validation modal, not the mapping error:

    No agent handling in the import flow: grep for agent_ / expensify.ai / isAgent / copilot / delegate across ImportTransactions.ts, ImportSpreadsheet.ts, TransactionsImportedPage.tsx returns nothing. The import creates an optimistic card for the current importing user's accountID as cardholder (ImportTransactions.ts:246-247, 277-279) — i.e. it tries to make the agent a cardholder, which the backend likely rejects.

    PR #95421 scope: touched only navigation/settings visibility (ModalStackNavigators, SettingsSplitNavigator, withAgentAccessDenied, InitialSettingsPage, ProfilePage, SecuritySettingsPage, TestToolMenu) — no import logic. It made the Wallet + "Import transactions" reachable for agents for the first time.

    Alternative explanations considered: (a) plain client validation failure — ruled out, because that shows a different inline message, not the reported modal; (b) unparseable dates / non‑numeric amounts producing zero rows — possible but would reproduce for non‑agents too, whereas this is filed specifically against the agent flow that PR #95421 exposed.

    Not yet confirmed with logs: I could not run VictoriaLogs this run (VL MCP not connected), so I have not confirmed the exact backend jsonCode. To verify, check whether IMPORT_CSV_TRANSACTIONS was invoked for the agent account and what it returned around the repro time — search tester activity 2026‑07‑09. A non‑200 there confirms the backend‑rejection root cause.


    Next Steps for Contributor+ team:
    To accept option 1 (hide Import for agents, App‑side): @MelvinBot implement [this](https://github.com/Expensify/App/issues/95755) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting this analysis.

  6. yuwenmemon commented on Jul 9, 2026

    @yuwenmemon
    Contributor

    Not a blocker.

  7. yuwenmemon commented on Jul 9, 2026

    @yuwenmemon
    Contributor

    I guess the answer is this:

    If agents SHOULD be able to import: the fix is server‑side (Web‑Expensify/Auth IMPORT_CSV_TRANSACTIONS command must accept agent cardholders). That is outside the App repo — an internal engineer should investigate and confirm the backend rejection.

  8. added
    ImprovementItem broken or needs improvement.
    InternalRequires API changes or must be handled by Expensify staff
    and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jul 9, 2026
  9. NicolasBonet commented on Jul 20, 2026

    @NicolasBonet
    Contributor

    This was merged and in prod

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

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringImprovementItem broken or needs improvement.InternalRequires API changes or must be handled by Expensify staffWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions