Repository navigation
fix: hide ineligible move report destinations - #102579
Beamanator wants to merge 8 commits into
Conversation
|
@linhvovan29546 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] |
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. |
6e59b62 to
3aec973
Compare
|
@MelvinBot review |
Code reviewThe fix targets the right spot: the new check runs before the policy-admin/report-manager fallback, so admins no longer see a destination that the backend rejects. CI passes on 1. Stale totals can override a complete local transaction set ( The two signals are joined with const hasCompleteLocalTransactions = transactions.length > 0 && moneyRequestReport?.transactionCount === transactions.length;
const hasOnlyNonReimbursable = hasCompleteLocalTransactions
? hasOnlyNonReimbursableTransactions(moneyRequestReport?.reportID, transactions)
: hasOnlyNonReimbursableTransactionsFromReportTotals;2.
3. The UI test only asserts that a report is absent (
Minor notes (no change required)
|
3aec973 to
df142e9
Compare
|
@MelvinBot re-review |
Re-reviewThe new commit (
I'd fix item 1 before merging. Items 2 and 3 are small follow-ups. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 512beba164
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@Beamanator The new changes in the PR don’t match the “Explanation of Change” in the PR description. Could you please check it? |
@Beamanator Could you please check this comment? Thanks! |
|
@Beamanator Could you please take a look at this PR when you have a chance? Thanks! |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
🤖 Posted by Codex, an AI coding agent acting for @Beamanator. Manual QA screenshots for #102579All 34 saved screenshots are embedded below, grouped by the PR's test steps. The first nine were captured on final App head Android/iOS entries below are touch-enabled browser profiles on macOS, not native-app or physical-device results. Native Android and iOS remain unverified because Mapbox dependency downloads returned HTTP 401. The JS console had existing unrelated warnings, so a clean-console result is not claimed. Final PR head after latest-main merge (`7766857`) — 9 screenshotsOpen non-reimbursable Draft and its loaded transaction after policy change Admin picker excludes the Open non-reimbursable Draft Admin picker lists the mixed destination Offline picker excludes the cached Open Draft Offline picker lists the cached mixed destination Valid move succeeds Moved expense remains in destination after reload Normal member's Open non-reimbursable Draft Normal member's picker excludes that Draft Fixture and core picker checks (Tests 1–4, 7; full matrix at `8a0551d`) — 7 screenshotsOpen non-reimbursable Draft after switching to instant Submit & Close Admin picker excludes the Draft Exact-name search excludes the non-reimbursable Draft with more than 12 outstanding reports Exact-name search lists the mixed destination Valid move to mixed destination appears after reload Normal member's own Open non-reimbursable Draft Normal member's picker excludes that Draft Exception and partial-cache checks (Tests 5–6) — 7 screenshotsReopened non-reimbursable Open Draft Reopened Draft remains selectable Move into reopened Draft succeeds Manual-submit non-reimbursable Draft remains selectable Move into manual-submit Draft succeeds Partial transaction cache leaves destination visible Destination is excluded after its transaction loads Offline and reconnect checks (Offline tests 1–2) — 5 screenshotsPicker from cached data while offline Open non-reimbursable Draft excluded offline Mixed destination listed offline Picker after reconnect Open Draft still excluded after reconnect Other browser profiles — 6 screenshotsDesktop WebKit excludes the Open Draft Pixel 7 touch Chromium profile excludes the Open Draft Pixel 7 touch Chromium profile lists the mixed destination Pixel 7 touch Chromium profile shows the move after reload iPhone 15 touch WebKit profile excludes the Open Draft iPhone 15 touch WebKit profile lists an eligible destination |
|
🤖 Posted by Codex, an AI coding agent acting for @Beamanator. Following up on #102579 (comment): the feedback was valid for the earlier PR description. The description has since been rewritten, and I checked it against the current PR head The “Explanation of Change” now describes the implemented checks: Code: Lines 3273 to 3289 in 7766857 App/src/pages/iou/request/step/IOURequestEditReportCommon.tsx Lines 223 to 265 in 7766857 No additional code change is needed for this description feedback; the current code commit is |
|
@MelvinBot Review |
|
🤖 Web test steps verification results: Fixture setup was blocked: the browser automation reported Create expense covered by its containing dialog. A manual-submit workspace and empty report were created, but no PR behavior was verified.
Code review: No new blocking issue found in the current diff. The three previous findings are addressed: complete transactions replace aggregate-total inference, transaction checking short-circuits on policy, and the UI regression test asserts an eligible sibling remains visible. Human independent approval remains outstanding; this run does not certify browser QA. |
@Beamanator I tested this as a normal workspace member who owns a non-reimbursable-only draft. After the admin retracted it, the report isn't listed on the Move to report page. The same happens on main, so this isn't a regression from this PR and should be handled separately so it doesn't block this one. We can update this QA step accordingly, for example by limiting the "retracted/reopened draft remains available" check to admins and report managers. Screen.Recording.2026-11-09.at.22.19.02.mov |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-11-09.at.22.23.02.moviOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-11-09.at.22.00.00.mov |
linhvovan29546
left a comment
There was a problem hiding this comment.
Could you please check all the PR author checklist?
|
@Beamanator friendly bump, could you take a look when you have a moment? |



































Explanation of Change
The move expense picker excludes an existing expense report when its workspace uses instant submit with Submit & Close and a complete locally loaded set of its transactions is non-reimbursable. The check runs before the policy admin/report manager fallback that can otherwise offer a destination rejected by Auth. Reopened or retracted Open drafts remain available. The filter uses transaction reimbursement flags, since aggregate report totals can be stale or cancel out, and recalculates as destination transactions load. It does not change automatic report reuse or backend validation.
When the complete destination transaction set is not yet in local Onyx, the picker keeps the report available. The client cannot establish that every transaction is non-reimbursable from a partial cache.
The picker uses a selector over the derived report-transaction map because its entries have no individual Onyx keys. The selector checks only the paginated outstanding destinations and returns a small ID map; unrelated transaction updates may rerun this bounded check but do not rerender the picker when its eligible destinations are unchanged.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/418073
PROPOSAL: https://github.com/Expensify/Expensify/issues/418073#issuecomment-5895188493
Tests
npm run test -- --runTestsByPath tests/unit/ReportUtilsTest.ts tests/ui/IOURequestEditReportCommonTest.tsx --runInBand,npm run typecheck,npm run lint-changed,npm run react-compiler-compliance-check check-changed, andnpm run spell-changed.Offline tests
QA Steps
Local QA Results (2026-11-07)
The full browser matrix tested App head
8a0551dbd53881ee81b3ae02121bdd94510ec727. Aftermainadvanced again, it was merged cleanly and pushed at final PR head7766857ec57e69d3a6cab004e3b1349ae27f489d; the PR's four-file diff againstmaindid not change. Auth and Web-Expensify were refreshed again, Auth/Bedrock and related VM services were rebuilt/restarted, and the core admin, normal member, offline, and valid-move flows passed again on the final head. The fixture uses synthetic local accounts and workspaces.jsonCode200 and appeared after reload. Exact-name search worked with more than 12 outstanding reports. With the Open regression fixture fully cached, offline search excluded it and listed the mixed report; reconnect preserved the exclusion. An isolated partial-cache experiment kept the report available until its destination transaction loaded, then excluded it; no invalid move was attempted.https://burp/resource, and expected network errors during the deliberate offline test. No failed move API request or new error tied to this change was observed. The no-console-errors checkbox stays unchecked.approveAndMergewas skipped, andCheck independent approvalfailed because it requires a human approval. No approval was submitted or bypassed.Full screenshot evidence, including nine post-merge captures, and test caveats.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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
Blocked before install: Gradle receives HTTP 401 for required Mapbox Maven artifacts. The emulator booted, but no PR build was installed, so this platform is unchecked.
Android: mWeb Chrome
Pixel 7 touch Chromium profile emulated on macOS at the full-matrix head; this does not certify a physical Android Chrome run. The final-head diff is unchanged.
iOS: Native
Blocked before install: CocoaPods receives HTTP 401 for MapboxCommon. No PR build was installed in the iOS simulator, so this platform is unchecked.
iOS: mWeb Safari
iPhone 15 touch WebKit profile emulated on macOS at the full-matrix head; this does not certify a physical iOS Safari run. The final-head diff is unchanged.
MacOS: Chrome / Safari
Headless Chromium and WebKit browser engines on macOS. The first three screenshots below are from the final PR head after the latest-main merge. Full evidence index above includes search, moves, member role, and partial cache.
🤖 Posted by Codex, an AI coding agent acting for @Beamanator.