Skip to content

IOU - An expected error when Pay with wallet to user without wallet #98966

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: v9.4.55-4
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #95005
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Windows 11 / Chrome, Android 13 / Xiaomi Poco F5
App Component: Money Requests

Action Performed:

Preconditions:

  • User A: Enable the wallet as payer account
  • User A and B set the USD currency
  1. Login as user A (payer)
  2. Start chat with user B > click + button > Pay B
  3. Enter any amount > Pay with wallet
  4. Open the expense details

Expected Result:

User A successfully Pay with wallet to a user without a wallet

Actual Result:

An expected error when Pay with wallet to user without wallet

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7237070_1787131969332.98919_-_PR95005_-_IOU_-_An_expected_error_when_Pay_with_wallet_to_user_without_wallet.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7237070

Upwork Automation - Do Not Edit

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 19, 2026
  2. applause-bot commented on Aug 19, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/f73973d31231cc78d9e48fdeb1143d477b73551cb71f0288437b4a8b1bef4e71

  3. MelvinBot commented on Aug 19, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    Root Cause: The App is correctly rendering an error that the backend returns. Paying a wallet‑less recipient with the Expensify Wallet should hold the funds (a "Payment is on hold until they enable their wallet" state), but the backend command is instead responding with a failure jsonCode. The frontend only ever attaches this generic error on an API failure of the wallet‑payment command — there is no client‑side/optimistic path that produces it — so the red "Unexpected error. Please try again later." on the expense is a faithful reflection of a backend rejection, not an App bug.

    This almost certainly means the frontend for the held‑payment feature (PR #95005) merged ahead of its companion backend support. That PR's own description notes it "relies on the companion backend change… so the user‑initiated cancel actually returns the held wallet funds." If the backend doesn't yet accept/hold a wallet payment to a wallet‑less recipient, the very first step (Pay) errors out and QA never reaches the new Cancel‑payment flow.

    Recommended Fix: This requires a change outside the App repo — the wallet‑payment backend command must accept a payment to a wallet‑less recipient and place it in the held/queued state instead of returning an error. Please escalate to an internal engineer with backend access (this ties to the internal issue linked from PR #95005). No App‑repo code change is needed to stop the error; the App is behaving correctly.

    Investigation details & evidence

    How the error surfaces (all in the public App repo, SHA 07a4f68):

    • The "Pay with wallet" path routes to WRITE_COMMANDS.PAY_MONEY_REQUEST_WITH_WALLET (or SEND_MONEY_WITH_WALLET for the + → Pay send‑money flow): PayMoneyRequest.ts:930-938.
    • The error is set only in failureData (applied by Onyx only on a non‑200 API response) — it attaches iou.error.other to the PAY IOU report action: PayMoneyRequest.ts:416-425 (and the send‑money equivalent in SendMoney.ts). Optimistic/success data never sets it.
    • It renders as the red brick‑road row via getLatestErrorMessageField(action) inside OfflineWithFeedback: ReportActionItem.tsx:596-604.
    • Copy: iou.error.other = "Unexpected error. Please try again later." — en.ts:1597.

    What the correct (non‑error) outcome looks like: a REIMBURSEMENT_QUEUED action rendered by ReimbursementQueuedContent.tsx showing "started settling up. Payment is on hold until {name} enables their wallet." with an "Enable wallet" button — iou.waitingOnEnabledWallet at en.ts:1626. Seeing a red error instead of this queued action is the tell that the backend rejected the payment.

    Alternative explanations considered:

    • Frontend optimistic bug — ruled out: no optimistic/success branch sets this error; it exists only in failureData.
    • Missing receiver‑wallet pre‑check in App — the KYCWall path checks the payer's wallet, not the recipient's, so the App legitimately hands the "held payment" decision to the backend by design.

    Production log confirmation: I was unable to pull VictoriaLogs in this run (the log tooling wasn't available). To close this out definitively, an engineer can check the jsonCode returned by the wallet‑payment command for a wallet‑less recipient in the reported window (~2026‑08‑19, v9.4.55‑4) — a non‑200 code with no REIMBURSEMENT_QUEUED action confirms the backend rejection.

    Possibly related: #96345 — "[Exploratory] Report - Error appears on the report when Cancel Payment" (same P2P‑wallet cancel/hold feature area; may share the same backend dependency).


    Next Steps: This needs a backend change and can't be fixed in the App repo — an internal engineer should verify/deploy the held‑payment backend support behind PR #95005. Reply with @MelvinBot <your feedback> to refine this analysis.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 19, 2026
  5. melvin-bot commented on Aug 19, 2026

    @melvin-bot

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

  6. melvin-bot commented on Aug 19, 2026

    @melvin-bot
  7. melvin-bot commented on Aug 24, 2026

    @melvin-bot

    @Krishna2323 Eep! 4 days overdue now. Issues have feelings too...

  8. melvin-bot commented on Aug 26, 2026

    @melvin-bot

    @Krishna2323 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  9. melvin-bot commented on Aug 28, 2026

    @melvin-bot

    @Krishna2323 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

  10. Krishna2323 commented on Aug 31, 2026

    @Krishna2323
    Contributor

    @MelvinBot can you please check #95005 (comment) and confirm this issue can be closed?

  11. MelvinBot commented on Aug 31, 2026

    @MelvinBot
    Contributor

    Yes — I agree this can be closed as "not a bug", with one caveat: nobody posted a retest result after KioCoan updated the QA preconditions, so the closure rests on his explanation rather than a fresh QA pass.

    Why the App side supports closing:

    • The error is set only in failureData — it attaches on a non-200 API response and nothing else: src/libs/actions/IOU/PayMoneyRequest.ts:416-425. There's no optimistic or client-side path that produces "Unexpected error. Please try again later.", so the App is faithfully rendering a backend rejection. That matches KioCoan's explanation exactly: the payment was rejected because one side was a test wallet (staging, activated with test PII) and the other wasn't — an environment artifact, not a code defect in App.
    • PR [Payment due @Pujan92] Add Cancel payment action for pending P2P wallet payments #95005 has been in production since 2026-08-20 (v9.4.56-3) and no new reports of this error have come in over the 11 days since — no real-user duplicates.

    What I could not verify: the backend rejection rule itself. The Auth repo isn't accessible from this run, and log tooling wasn't available, so I have no server-side jsonCode to confirm the test-wallet mismatch was the actual cause.

    Suggested path: ask mitarachim to rerun the updated QA steps on #95005 (User B must complete only the Additional Details step with test PII, and stop). A passing retest turns this from "explained" into "confirmed". If a retest isn't practical, closing on the current evidence is reasonable.

    Note #96345 ("Error appears on the report when Cancel Payment") is a separate open issue in the same feature area — closing this one doesn't cover it.


    view run

    Evidence (1)

    Recordings

    - [▶ Session recording of the verification run](https://melvinbot-assets.exops.io/session-33351230669-1-70d1d3f5-014b-470a-8b8a-ae38551e84ae.webm)
  12. melvin-bot commented on Sep 2, 2026

    @melvin-bot

    @Krishna2323 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  13. melvin-bot commented on Sep 3, 2026

    @melvin-bot

    @Krishna2323 Whoops! This issue is 2 days overdue. Let's get this updated quick!

  14. melvin-bot commented on Sep 3, 2026

    @melvin-bot

    @Krishna2323 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  15. melvin-bot commented on Sep 4, 2026

    @melvin-bot

    @Krishna2323 Whoops! This issue is 2 days overdue. Let's get this updated quick!

  16. melvin-bot commented on Sep 7, 2026

    @melvin-bot

    @Krishna2323 Still overdue 6 days?! Let's take care of this!

  17. Krishna2323 commented on Sep 8, 2026

    @Krishna2323
    Contributor

    This issue should be closed as per this: #95005 (comment)

  18. melvin-bot commented on Sep 11, 2026

    @melvin-bot

    @Krishna2323 Whoops! This issue is 2 days overdue. Let's get this updated quick!

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions