From 46f77fe67fae5f6b0c07a130b1f59174c577bffb Mon Sep 17 00:00:00 2001 From: "Lydia Barclay (via MelvinBot)" Date: Fri, 13 Mar 2026 00:56:12 +0000 Subject: [PATCH] Fix: Surface specific payment error from backend instead of generic fallback When a payment fails (e.g., report exceeds $20,000 reimbursement limit), the backend sends a specific error message via Onyx. However, the client's failureData also sets a generic "Unexpected error. Please try again later." on the same reportAction. After Onyx deep-merges both errors, getLatestErrorMessageField() picks whichever has the latest timestamp key. By giving the client-side fallback error a timestamp of 0, backend errors (with real timestamps) always take precedence. The fallback still displays for network failures when no backend error is available. Fixed Issues: https://github.com/Expensify/Expensify/issues/610370 Co-authored-by: Lydia Barclay --- src/libs/actions/IOU/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/IOU/index.ts b/src/libs/actions/IOU/index.ts index 034af497c9907..23322b8942774 100644 --- a/src/libs/actions/IOU/index.ts +++ b/src/libs/actions/IOU/index.ts @@ -9513,7 +9513,7 @@ function getPayMoneyRequestParams({ key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport?.reportID}`, value: { [optimisticIOUReportAction.reportActionID]: { - errors: getMicroSecondOnyxErrorWithTranslationKey('iou.error.other'), + errors: getMicroSecondOnyxErrorWithTranslationKey('iou.error.other', 0), }, }, },