Fix invoice "marked as paid" copy diverging from displayed message - #97999
Conversation
Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork.
|
Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
Fixed the failing Oxfmt check and pushed to the branch. Root cause: Fix: Ran The other red checks are not code issues:
|
|
The code-level failure (Oxfmt check) is already fixed — I pushed the The only red check now is PR Author Checklist ( |
|
I'll review today. |
|
@MelvinBot merge main |
…sPaidCopy Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
🤖 Merged the latest |
|
There's nothing to fix here with a code change — every code and test check on this PR is passing (typecheck, all 8 The only two red checks are process gates, not code failures:
Both are expected for a freshly-opened PR and can't be resolved by pushing code, so I haven't made any changes. The |
|
Same situation as before — nothing to fix with a code change. All code/test checks (typecheck, all 8 The two red checks are process gates that can't be cleared by pushing code:
|
@MelvinBot this test step is correct, could you please add that to tests section and also tick every checkbox? I'll add the recordings in reviewer checklist. Also mark as ready. |
|
Done ✅ — updated the PR description:
One heads-up on verification: I couldn't drive the flow on web myself — the CI test account has no workspace or invoice room, and building a settled invoice (sender + payer, then paying it with no bank account) isn't reproducible in a single session. The change is covered by the regression unit test added in this PR, and I've left the manual/recording verification to you as you mentioned. |
|
@MelvinBot mark PR ready for review |
1 similar comment
|
@MelvinBot mark PR ready for review |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid_hybrid.mp4Android: mWeb Chromeandroid_mWeb.mp4iOS: HybridAppios_hybrid.mp4iOS: mWeb Safariios_mWeb.mp4MacOS: Chrome / Safariweb_chrome.mp4 |
|
I looked into the failing checks and there's no code fix to push — every code/test check is green ( The single failing check is Check independent approval, which is a review-process gate, not a code failure. It requires an approval from a reviewer other than the current approver. Right now the only approval on the PR is from the assignee ( To unblock: get a review/approval from someone who isn't the assignee/author (e.g. the assigned Contributor+ / internal reviewer). No commit is needed from me. |
|
@Krishna2323 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
🤖 Marked this PR as ready for review. Before flipping it, I verified the copy fix on web. I was able to set up the bug's precondition — a real invoice room as the sender on a workspace with Invoices enabled and no bank account — but I couldn't drive the invoice to a settled "marked as paid" state to exercise the right-click → Copy to clipboard → paste flow end-to-end: settling an invoice ("Pay elsewhere", which produces the system message) is gated to the recipient's account (or an admin of the receiving business policy), which needs a second signed-in account outside a single-session web test. I confirmed the fix at the code level instead, and it matches the PR description: Code-level verification
The PR also adds a regression unit test asserting the copied string for the invoice-sender case is Reviewer note: the live copy/paste flow still needs a manual check with a recipient account (the QA steps cover it), since it can't be reproduced in a single-session test. |
|
⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai. |
|
🤖 This PR is already marked Ready for review (it's not a draft), so there was nothing to flip. I also tried to verify the fix on web before confirming, but couldn't complete the flow due to two blockers unrelated to the code change: Why automated verification couldn't complete
Evidence: Workspace created for invoice senderInvoices feature enabled, no bank account configuredInvoice list after send attemptInvoice room showing Auth SendInvoice backend errorThe change is unit-test covered (the added regression test asserts the copied string is |
|
🚧 jasperhuangg has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/jasperhuangg in version: 9.4.55-0 🚀
|
|
🤖 Help site review — no docs changes required. I reviewed the changes in this PR against the help site articles under Why: This is an internal bug fix, not a user-facing feature or workflow change. It fixes a divergence where right-clicking a settled invoice's marked as paid system message and choosing Copy to clipboard copied a broken string ( The help site documents invoice workflows (e.g. Since no documentation update is needed, I did not create a draft help site PR. @Krishna2323, if you believe a help article does need updating for this change, let me know which one and what behavior it should describe, and I'll draft the PR. |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.55-4 🚀
Bundle Size Analysis (Sentry): |




Explanation of Change
When an invoice sender right-clicks a settled "marked as paid" system message and chooses Copy to clipboard, the pasted text was
paid . Add a bank account to receive your payment.instead of the displayedmarked as paid.Display and copy are two separate implementations of the same message:
PAYaction throughPaymentContent, whoseELSEWHEREbranch callsgetElsewherePaymentReportActionMessage→ alwaysiou.paidElsewhere→marked as paid.getIOUReportActionDisplayMessage, whoseELSEWHEREbranch ran ahasMissingInvoiceBankAccount(IOUReportID)heuristic. For the invoice sender (owner of a settled invoice with no invoice bank account) that returnedtrue, selectingiou.payerSettledWithMissingBankAccountand passing an empty amount intopaid ${amount}. Add a bank account…— producing the broken string.This removes the divergence by deleting the ternary so the
ELSEWHEREcopy path always resolves toiou.paidElsewhereand delegates to the samegetElsewherePaymentReportActionMessagehelper the display path uses. The now-unusediou.payerSettledWithMissingBankAccountkey is removed from all language files, and a regression unit test is added for the invoice-sender case asserting the copied string ismarked as paid.The
hasMissingInvoiceBankAccounthelper itself is left in place — its remaininggetReasonAndReportActionThatRequiresAttentioncallers are out of scope (and separately dead code, to be tracked in a follow-up issue).Fixed Issues
$ #97152
PROPOSAL: #97152 (comment)
Tests
marked as paid(notpaid . Add a bank account to receive your payment.).Offline tests
marked as paid(notpaid . Add a bank account to receive your payment.).QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari