Repository navigation
Conversation
|
@MelvinBot review |
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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. |
ReviewOne blocking issue: offline, picking Pay via workspace name (IOU reports) or an invoice Pay via Expensify bank account now marks the report as paid instead of showing the offline modal. A locked account can also do this, because the locked-account check is skipped. Why: The offline branch in
Suggested fix: in the offline branch of Minor (non-blocking): the primary Pay button calls The rest looks good. The |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 102b8534b4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The blocking issue is valid, addressed in 0d03a8b The minor issue I'd believe is counterintuitive to end user - sometimes the button would show modal and sometimes it wouldn't. Addressed with note in pr description |
|
@codex review |
|
@MelvinBot re-review please |
Re-reviewNo remaining issues. 0d03a8b fixes the blocking issue.
Your call on the primary Pay button is reasonable. Showing the modal consistently is clearer than showing it only sometimes. |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
JakubKorytko
left a comment
There was a problem hiding this comment.
a few things on the offline guard design and the new tests, nothing blocking tho
| return; | ||
| } | ||
| if (isOffline) { | ||
| // Mark as paid can be queued offline. Other methods may need KYC or bank setup, and select-all is resolved server-side. |
There was a problem hiding this comment.
once Mark as paid gets past this offline, getSearchPayOnyxData sets isActionLoading: true and only clears it (and drops the row from the snapshot) in success/failure data. So the paid rows probably sit with a spinner in Ready to pay until the user reconnects, while the selection is already cleared. Could you check if that's the case? And if so, is that the look we want offline?
Also, the same idea is written out here, in Search.ts and in several test comments, with different names for the same thing (ELSEWHERE / Pay elsewhere / Mark as paid, select-all / Select all / all matching). One short comment in one place and one name would read better, don't you think?
There was a problem hiding this comment.
I tested it offline and there is no spinner. payMoneyRequest's optimistic data flips the report to Paid right away, so the row's action becomes View (which never shows a spiner), and the row is greyed out as pending like other offline changes. In Ready to pay the row stays listed as Paid/pending until we reconnect and the success data removes it, which matches how other pending offline actions look. So I'd keep it as it is
As for the comments, done in 406b736
| // While offline, route every payment method straight to the offline modal via confirmPayment (onBulkPaySelected), | ||
| // before any branch below can navigate the user into a KYC / account-verification / add-bank-account / restricted-action flow. | ||
| if (isOffline) { | ||
| // While offline, send every payment method except Mark as paid to the offline modal via confirmPayment (onBulkPaySelected), |
There was a problem hiding this comment.
three lines that explain how onBulkPaySelected and getActivePaymentType work inside. That goes stale as soon as either changes. One line about the why is enough, e.g. // Offline, only Mark as paid can be queued and everything else shows the offline modal. or something
There was a problem hiding this comment.
Trimmed to one line about why we check in the menu key instead of paymentType in 406b736
| if (isOffline && item.key !== CONST.IOU.PAYMENT_TYPE.ELSEWHERE) { | ||
| Log.info('[BulkPay] Blocking bulk pay: offline, deferring to the offline modal'); | ||
| confirmPayment?.(paymentType as PaymentMethodType, item?.additionalData as BulkPaySelectionData | undefined); | ||
| confirmPayment?.(undefined); |
There was a problem hiding this comment.
passing undefined to get the offline modal is a hidden contract with onBulkPaySelected and it only works because the hook reads "not ELSEWHERE" as "block". The "what can be paid offline" rule is now in two files, keyed on item.key here and on paymentMethod there, so changing one side silently breaks the other. The root cause is getActivePaymentType falling back to ELSEWHERE for policy and unknown keys.
Could we have one helper (e.g. canPayOffline in PaymentUtils) used by both, and show the offline modal from here directly instead of going through confirmPayment with an empty type?
There was a problem hiding this comment.
Good idea, added canPayOffline. And handleBulkPayItemSelected now shows the offline modal directly, so confirmPayment(undefined) is gone. Done in 406b736
| // confirmPayment (onBulkPaySelected) is what surfaces the offline modal; the exact paymentType is not important here. | ||
| expect(baseParams.confirmPayment).toHaveBeenCalled(); | ||
| // confirmPayment (onBulkPaySelected) is what surfaces the offline modal. It must get no payment type, because | ||
| // 'ACH' maps to ELSEWHERE, which onBulkPaySelected would pay offline. |
There was a problem hiding this comment.
'ACH' is the raw value of CONST.IOU.PAYMENT_TYPE.VBBA, and the item above uses the constant, so readers won't connect them. I would say VBBA and keep this to one line without the onBulkPaySelected internals
| expect(baseParams.confirmPayment).toHaveBeenCalledWith(undefined); | ||
| }); | ||
|
|
||
| it('should hand Mark as paid to confirmPayment while offline so it can be paid optimistically', async () => { |
There was a problem hiding this comment.
the name promises an optimistic payment, but the test only checks the handoff to confirmPayment. Dropping "so it can be paid optimistically" would match what is asserted
| expect(paymentTypes).not.toContain(CONST.IOU.PAYMENT_TYPE.ELSEWHERE); | ||
| }); | ||
|
|
||
| it('should not hand Pay via workspace to confirmPayment as Mark as paid for a locked account while offline', async () => { |
There was a problem hiding this comment.
the locked account check is never reached here, the offline guard returns first with confirmPayment(undefined). So this is the 'Pay via workspace' row above plus a flag that does nothing, and the assertion at 859 has the same pass-if-not-called problem. I would drop it, or fold it into the table and assert toHaveBeenCalledWith(undefined) plus showLockedAccountModal not called.
Side note: the same policy setup block is copied five times in the new tests, a small factory would help.
| }); | ||
|
|
||
| // Then the offline modal should open and no payment should be triggered because payments must not be queued while offline | ||
| // Then the offline modal should open and no payment should be triggered because bank payments can't be completed offline |
There was a problem hiding this comment.
this test taps the main Pay option (onBulkPaySelected(undefined)), not a bank payment, so the new reason doesn't match what it exercises. The real reason is that the method is unknown here. I would revert this line or reword it
| }); | ||
| }); | ||
|
|
||
| describe('useSearchBulkActions - offline bulk pay', () => { |
There was a problem hiding this comment.
hmmh, this copies the beforeEach/afterEach/render setup from the blocks above. These three cases could go into the existing Pay option describe, which already has an offline test, or share a setup helper
There was a problem hiding this comment.
Moved the cases into the existing Pay option.
| expect(mockClearSelectedTransactions).toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it('still shows the offline modal when paying with a business bank account offline', async () => { |
There was a problem hiding this comment.
"still" only makes sense next to this diff. "shows the offline modal when ..." reads fine later. Same for the select all test below and "should still block Mark as paid" in the other file
|
|
||
| // When the user picks the business bank account option from the bulk Pay submenu | ||
| await act(async () => { | ||
| result.current.confirmPayment(CONST.IOU.PAYMENT_TYPE.VBBA); |
There was a problem hiding this comment.
offline, handleBulkPayItemSelected never sends VBBA anymore, it sends undefined. So this covers a call the menu can't make. confirmPayment(undefined) is the path that has to keep showing the modal
…de-mark-as-paid # Conflicts: # tests/unit/hooks/useSearchBulkActionsPayTest.ts
JmillsExpensify
left a comment
There was a problem hiding this comment.
Makes sense to me.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppUploading az_recorder_20261122_234846.mp4… Android: mWeb Chromeaz_recorder_20261122_234846.1.mp4iOS: HybridAppScreen.Recording.iPhone.17.Pro.23-11-2026.at.00.06.51.1.mp4iOS: mWeb SafariScreen.Recording.iPhone.17.Pro.22-11-2026.at.23.54.03.3.mp4MacOS: Chrome / SafariCleanShot.2026-11-22.at.23.34.55.2.mp4 |
|
🚧 grgia 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/grgia in version: 9.5.53-0 🚀
|
|
No help site update needed — this fixes expected offline behavior for bulk marking reports as paid, without adding a new workflow or making any existing article sentence incorrect. |
|
Deploy Blocker #107784 was identified to be related to this PR. |
|
Deploy Blocker #107797 was identified to be related to this PR. |
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.5.53-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
In Spend -> Ready to pay, choosing Mark as paid from the bulk Pay menu while offline showed the "You appear to be offline" modal, even though marking as paid only records a payment made outside Expensify and is an optimistic, queueable write (the same way that single-report Mark as paid uses offline).
Bulk pay has two offline checks, and both blocked every payment method:
handleBulkPayItemSelected(src/libs/actions/Search.ts) returned early offline for every method.onBulkPaySelected(src/hooks/useSearchBulkActions.ts) showed the offline modal for every method.This PR exempts
CONST.IOU.PAYMENT_TYPE.ELSEWHERE(Mark as paid) from both:onBulkPaySelected, Mark as paid now goes through topayMoneyRequestoffline. "Select all matching" is still blocked offline, because the reports to pay are resolved server-side from the search query (queueBulkPayReports).handleBulkPayItemSelected, Mark as paid no longer skips the delegate / locked-account / billing checks when offline, so a locked account still can't mark reports as paid offline.The business bank account (VBBA) path and other payment methods that move real money are intentionally left online-only. They can require account validation, KYC or bank account setup, which can't be completed offline, so they still show the offline modal.
Note
While offline, the primary pay button still shows the offline modal even when the last payment method was Mark as paid. This is intentional; the primary button works out the last-used method per report, and a bulk selection can mix Mark as paid with methods that can't be paid offline. Only an explicit Mark as paid choice from the submenu goes through offline.
Fixed Issues
$ #102507
PROPOSAL: N/A
Tests
Precondition: a workspace with (two expenses, submitted andapproved) that shows in
Spend -> Ready to pay. Open Ready to pay while online so the list loads.A. Mark as paid in bulk while offline
Spend -> Ready to paySpend -> Reportsand verify the report shows as Paid.B. Locked account can't mark as paid while offline
Additional precondition: Use Locked account/Lock the account
C. Select all matching is still blocked offline
Additional precondition: Have more than 50 reports ready to be paid.
Spend -> Ready to paywhile online, then go offline.D. Other payment methods are still blocked offline
Additional precondition: an IOU report (expense request from another user) in USD, ready to pay, where you are an admin of at least one workspace.
Spend -> Ready to paywhile online, then go offline.Offline tests
Same as tests. Tests A, B and C are all performed offline.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveOffline stepssection - [x] I added steps for Staging in theQA stepssectionto ensure there are no regressions that impact usability).
shared library or component like
Aponents usingAvatar` are working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)and verified all stories for that c as expected.
Designlabel and/or tagged@Expensify/designso the design team can review the changes.selected).
feature or bug fix in this PR to heegressions in this user flow.
mainbranch was merged into this PR after a review, I tested again and verified theoutcome was still expected accordin
Screenshots/Videos
iOS: Native
Screen.Recording.2026-11-03.at.15.13.09.mov
MacOS: Chrome / Safari
Screen.Recording.2026-11-03.at.13.39.50.mov
Screen.Recording.2026-11-03.at.13.41.23.mov