Commit 46f77fe
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: Expensify/Expensify#610370
Co-authored-by: Lydia Barclay <lydiabarclay@users.noreply.github.com>1 parent 6463086 commit 46f77fe
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9513 | 9513 | | |
9514 | 9514 | | |
9515 | 9515 | | |
9516 | | - | |
| 9516 | + | |
9517 | 9517 | | |
9518 | 9518 | | |
9519 | 9519 | | |
| |||
0 commit comments