Repository navigation
[Payment due @getusha] Fix invoice Pay actions with redacted sender policy data - #105553
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review The three review findings on the previous head were addressed in commit 🤖 Posted by Codex, an AI coding agent acting for @Beamanator. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@Beamanator I'm ooo, could you help assign another C+ to review this PR please? |
|
Sounds good! can you help review here please @getusha ? |
|
bump @getusha if you're not free, please let me know so i can find another reviewer 🙏 |
|
Sorry, will review today |
|
no worries! thanks so much! |
|
Setup
Test
@MelvinBot is this QA steps accurate drived from the PR tests |
|
Yes—for the invoice-payment regression, your steps match the PR tests, with these clarifications:
These steps cover the payment fix, not the full PR QA: policy redaction/cache clearing, search pagination, and shared-expense rendering still need separate coverage. This is a code/test comparison, not a fresh browser verification; I haven’t independently confirmed the “on main” observation. |
Reviewer Checklist
Screenshots/VideosiOS: HybridAppBuild issues |
|
@Beamanator we need to update QA steps it can be confusing 🙏 |
|
🎯 @getusha, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created. |
|
updated! all you @iwiznia 🙏 |
|
🚧 iwiznia 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/iwiznia in version: 9.5.36-0 🚀
|
|
No FullStory changes needed. This PR only fixes eligibility for existing invoice Pay and Pay Elsewhere actions when sender policy data is redacted or reimbursements are disabled, and adds regression tests. |
|
No help site update needed — this PR fixes existing invoice payment eligibility without adding a new workflow, removing a beta, or making existing article instructions incorrect. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.36-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Payment issue created: #106680 |




Explanation of Change
Auth's policy redaction leaves invoice viewers with only the sender policy's public identity. Invoice Pay and Pay Elsewhere must depend on the invoice and receiver authorization, even when the sender policy uses
reimburseNoor has no reimbursement setting in Onyx. This moves the invoice branch ahead of the sender reimbursement gate and adds regression tests for payment eligibility and the exact Onyx update methods Auth uses to replace previously cached full policy data. The companion Auth change is https://github.com/Expensify/Auth/pull/26135. This App change is intended to merge first so clients can handle redacted sender policies before Auth deploys.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/697049
PROPOSAL: https://github.com/Expensify/Expensify/issues/697049#issuecomment-6509455554
Tests
npm test -- --runInBand tests/unit/Search/NonmemberPolicyRedactionTest.ts tests/actions/IOUTest/ReportWorkflowTest.ts. Result: 113 passed. The tests apply Auth's first-page SET, later-page MERGE, SearchForTodos MERGE_COLLECTION, and policy SET to a cached full policy with synthetic credentials, bank and employee fields; they inspect both final top-level and snapshot state, including mileage rate lookup.Before-and-after check: the new invoice test failed against the original
ReportUtils.tsfrom base commit 40f7032 (Pay returnedfalsefor areimburseNosender policy), then passed with this PR restored.npm run typecheckand scopedbun scripts/lint/index.tson the three changed files. Both passed.MoneyRequestViewReportFieldsTest.tsxandMoneyReportViewTest.tsx: 48 passed.reimburseNoto a receiver workspace. As receiver admin in macOS Chrome, open the invoice, verify Pay and Mark as paid (Pay Elsewhere), reload, and verify the options persist. This passed; a $1.00 synthetic invoice was marked paid locally and a $1.02 invoice was left outstanding. No real funds moved.SearchForTodosresponse and final Onyx policy after a reload, including a cached policy seeded with synthetic private fields. The response contained only public identity fields and null clears; the final Onyx policy retained onlyavatarURL,id,name,role, andtype. Pay remained available to the authorized receiver admin.testTripRooms500 payload parse failure after the new redaction test passed. Current-head Auth CI Auth Tests passed.pageerrorevents. Their relationship to this PR has not been established, and a clean-console result has not been established.Offline tests
navigator.onLine === falseand the app's offline cue, and verify cached Pay and Mark as paid remain visible. Reconnect and reload; verify Pay remains visible. Completed in macOS Chrome with this App PR and the companion Auth head. No offline payment write was attempted.QA Steps
Prerequisites: Use staging with both this App change and the companion Auth change. Prepare two test workspaces: A sends invoices and B receives them. B’s admin needs a connected USD business bank account.
payInvoiceViaExpensify.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected) (Rendered report UI suites: 48 passed.)npm run compress-svg) (N/A: no assets changed.)Avataris modified, I verified thatAvataris working as expected in all cases) (N/A: no generic component changed.)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. (N/A: nomainmerge commit in this PR.)Screenshots/Videos
Android: Native
Not captured; this platform has not been manually tested with the companion Auth change.
Android: mWeb Chrome
Not captured; this platform has not been manually tested with the companion Auth change.
iOS: Native
Not captured; this platform has not been manually tested with the companion Auth change.
iOS: mWeb Safari
Not captured; this platform has not been manually tested with the companion Auth change.
MacOS: Chrome / Safari
Local macOS Chrome screenshots were captured for the combined App+Auth business-invoice flow, Pay action, Mark as paid menu, nonadmin view, offline view, and final Onyx state. They are saved in the local QA evidence bundle and are not attached to this PR. Safari remains untested.
🤖 Posted by Codex, an AI coding agent acting for @Beamanator.