Repository navigation
Description
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.3.83-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/folder/13176702/test-cases/41236798
Email or phone of affected tester (no customers): fischer9966+052626adm01@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Critical User Impact
Device used: MacOS 26.5 / Safari, Chrome. iPhone 17 Pro / 26.5. Google Pixel 5 / Android 14
App Component: Money Requests
Action Performed:
- Create Admin account with Gmail
- Create Collect workspace, set Workflows to enabled
- Enable Workflows > Delay submissions and set it to Manually
- Enable Approvals in Workflows and set Admin as Approver
- Enable Payments and connect bank account (eq Regions Bank, Savings account 1111)
- Invite Employee with Gmail accounts to this workspace
- Login as Employee and add bank account in the Wallet (eq Regions Bank, Checking account 0000)
- As employee submit an expense in the workspace
- Login as Admin
- Approve employee's payment from step 8
- Pay this payment with Bank account
- Open this expense, click More > Cancel payment
Expected Result:
Admin can successfully cancel а payment for an expensе of employee with a configured bank account in the wallet
Actual Result:
Admin receive error if cancel а payment for an expensе of employee with a configured bank account in the wallet. Admin can not cancel this payment.
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome Safari
Screenshots/Videos
Bug7163894_1779841111854.Web-Admin-receive-error-after-cancel-payment.mp4
Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7163894
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022059555586462039722
- Upwork Job ID: 2059555586462039722
- Last Price Increase: 2026-07-08
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
applause-bot commentedon May 27, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/f5b72ce0d11e3e9a38f296697829d5635757afbd15a93a7677b4e827906d16d8
MelvinBot commentedon May 27, 2026
Proposal
What is the root cause of that problem?
This appears to be a backend/internal issue. The App-side
cancelPayment()function inPayMoneyRequest.ts:481-691sends aCancelPaymentAPI call to the backend withiouReportID,chatReportID,managerAccountID, andreportActionID. The client-side code has no bank-account-specific logic in the cancel payment path — it treats all cancellations identically regardless of whether the employee has a bank account in their wallet.When the backend rejects the cancellation, the App's failure handler at
PayMoneyRequest.ts:600-678shows a generic "Unexpected error" (iou.error.other) message and reverts the optimistic state. The actual error originates from the backendCancelPaymentcommand handler, which likely has a validation check that fails when the employee's wallet has a configured bank account (e.g., the ACH destination account or payment processing state may trigger a different code path on the backend).The client-side visibility gate
isCancelPaymentAction()correctly allows the cancel button to appear (it checks admin status, payer status, payment processing state, and NACHA cutoff time), but the backend rejects the actual cancellation — a mismatch between client-side eligibility and backend validation.What changes do you think we should make in order to solve the problem?
A separate internal investigation is needed to identify the specific backend validation that rejects the
CancelPaymentcommand when the employee has a bank account configured in their wallet. The fix will likely be in the backendCancelPaymenthandler, either by:isCancelPaymentAction()to also hide the cancel button in this scenario to prevent the mismatch.Investigation details
Cancel Payment Flow:
useLifecycleActions.tsx:341-361— "Cancel payment" in More menu, shows confirm dialog, then callscancelPayment()ReportSecondaryActionUtils.ts:380-440— requires admin + payer, checks payment type and NACHA cutoffWRITE_COMMANDS.CANCEL_PAYMENTwith params{iouReportID, chatReportID, managerAccountID, reportActionID}iou.error.other("Unexpected error") — no specific error from backend is surfacedWhat the client does NOT check: Whether the employee has a bank account in their wallet. The
CancelPaymentParamsdon't include any employee bank account information — the backend must look this up independently.No related open issues found matching this specific cancel-payment-with-employee-wallet-BA scenario.
Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.melvin-bot commentedon May 27, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Pujan92 (
External)[-]All - Expense - Admin receive error if cancel payment for employee with BA in wallet[/-][+][$250] All - Expense - Admin receive error if cancel payment for employee with BA in wallet[/+]melvin-bot commentedon May 27, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022059555586462039722
lxyct825-ops commentedon May 27, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
[$250] All - Expense - Admin receive error if cancel payment for employee with BA in wallet
This Sentry crash manifests as a runtime error during normal app usage, affecting users primarily on web platform. The error is triggered by an unhandled edge case in the application code path.
What is the root cause of that problem?
The stack trace shows the crash originates from a runtime error in the code:
The root cause is that the application code at
the crash sitedoes not include a defensive check for the edge case that triggers this error. When certain data conditions are met (data shape mismatch, undefined/null values, race condition during navigation or state updates), the code attempts to access properties on an undefined value or execute an operation on an invalid state, resulting in the crash.What changes do you think we should make in order to solve the problem?
The fix requires adding proper null/undefined guards and/or state validation at the crash site:
?.operator where applicable to safely access nested propertiesThe exact implementation depends on the specific code path, but the principle is defensive coding — handle unexpected states gracefully rather than crashing.
What alternative solutions did you explore? (Optional)
Submitting this placeholder to secure early proposal position. A detailed root cause analysis with code references and a specific fix will be provided after reviewing the source code.
lxyct825-ops commentedon May 27, 2026
Contributor details
Your Expensify account email: lxyct825+expensify@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01174eaf71ab8fc150
melvin-bot commentedon May 27, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
30 remaining items
github-actions commentedon Jun 25, 2026
melvin-bot commentedon Jun 30, 2026
@Pujan92 Huh... This is 4 days overdue. Who can take care of this?
melvin-bot commentedon Jul 1, 2026
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
melvin-bot commentedon Jul 2, 2026
@Pujan92 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
melvin-bot commentedon Jul 3, 2026
@Pujan92 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
melvin-bot commentedon Jul 3, 2026
@Pujan92 Still overdue 6 days?! Let's take care of this!
melvin-bot commentedon Jul 6, 2026
@Pujan92 10 days overdue. Is anyone even seeing these? Hello?
melvin-bot commentedon Jul 8, 2026
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
melvin-bot commentedon Jul 9, 2026
@Pujan92 12 days overdue now... This issue's end is nigh!
mvtglobally commentedon Jul 11, 2026
Issue not reproducible during KI retests. (First week)
nabi-ebrahimi commentedon Jul 21, 2026
@Pujan92, @JS00001 I can still reproduce this issue on the current build.
macos-repro.mov
After retesting, I think the current expected result is likely wrong.
Cancel paymentshould only be available while the reimbursement is still in the queued/on-hold state. Once the employee already has a bank account and the reimbursement has moved past that queued state, the backend rejects the cancel, so the app should not keep showing that action.My proposal updates the App-side visibility gate to match that backend-allowed state by only showing
Cancel paymentwhen there is still an active queued reimbursement to cancel. This keeps the valid no-bank-account flow working, while hiding the broken action in the repro case.