Skip to content

fix: [GPS]Transactions - Always use iouRequestType to check for request type#88289

Merged
NicolasBonet merged 34 commits into
Expensify:mainfrom
TaduJR:fix-GPS-Transactions-Always-use-iouRequestType-to-check-for-request-type
May 28, 2026
Merged

fix: [GPS]Transactions - Always use iouRequestType to check for request type#88289
NicolasBonet merged 34 commits into
Expensify:mainfrom
TaduJR:fix-GPS-Transactions-Always-use-iouRequestType-to-check-for-request-type

Conversation

@TaduJR
Copy link
Copy Markdown
Contributor

@TaduJR TaduJR commented Apr 19, 2026

Explanation of Change

is{Type}Request() utilities had two detection paths: check iouRequestType directly (during creation), or infer the type from structural fields (comment.type, customUnit.name, waypoints, receipt.source) after the server save. The fallback existed because iouRequestType wasn't server-returned, and it forced a GPS-vs-Map hack tagging waypoints with keyForList: 'gps_start'/'gps_stop'.

Auth#19725 now sends iouRequestType on every transaction, so the fallback is redundant.

Changes:

  • Refactor — Every is{Type}Request is now a one-liner checking iouRequestType (isDistanceRequest checks the DISTANCE parent + its sub-types). Removed hasDistanceCustomUnit, hasGPSWaypoints, isManualRequest (dead), the isUpdatedMergeTransaction bypass, and simplified getRequestType.
  • Bug fixMergeTransaction.ts was writing iouRequestType: null during distance merges, breaking type detection under the simplified logic. Now falls back to the target transaction's type.
  • Architectural refactor — Two isScanRequest callers (MoneyRequestBuilder.ts, TrackExpense.ts) passed Partial<Transaction> shapes that would silently return false. Instead of inline !!receipt?.source && amount === 0 heuristics (CONSISTENCY-3), RequestMoneyInformation/CreateTrackExpenseParams now carry an explicit existingTransaction, threaded through every submission path — createTransaction, the distance-track flow (handleMoneyRequestStepDistanceNavigation), useExpenseSubmission, SubmitDetailsPage, IOURequestStepAmount, and the duplicate flow. Resolved a known TIME duplicate trade-off as a side effect.
  • Duplicate flow — Extracted getDuplicateRequestType() to coerce SCAN→MANUAL (since the duplicate flow strips the receipt). Wired into every duplicate call site — duplicateExpenseTransaction (workspace and unreported-track paths), createExpenseByType, and duplicateReport.
  • Retry payloadsrequestMoney/trackExpense were JSON-stringifying the entire existingTransaction into receipt-error retryParams persisted in Onyx. Replaced with a minimal shim (only iouRequestType + placeholders), keeping retries small while preserving type recovery.
  • FixesstartSplitBill sets iouRequestType on optimistic split transactions; buildMergedTransactionData propagates iouRequestType cross-subtype.
  • Type & cleanup — Narrowed isScanRequest to OnyxEntry<Transaction> (compile-time guard against partial shapes); dropped stale !!mergeTransactionID arg in MoneyRequestView; updated JSDoc on Transaction.iouRequestType.

Fixed Issues

$ #83028
PROPOSAL: #83028 (comment)

Tests

Before you start, set up:

  • A workspace with Per Diem rates configured.
  • A workspace with Time tracking enabled.
  • A workspace with distance rates configured, with tax turned on for the distance rate.
  • A sample receipt image (a photo of any receipt).
  • A mobile device (iOS or Android) — GPS distance tracking only works on a phone, so the GPS steps must be done there.

A. Creating each kind of expense shows the correct icon and details

For each expense below, after you submit it, check three places: the expense's row inside the report, the expense preview shown in the chat, and the expense details page (tap the expense to open it).

  1. Tap (+) → Create expense → Manual tab. Enter an amount, merchant, and date, then submit.
    Verify: the details page shows the amount and a Merchant field you can tap to edit; the expense row shows a cash icon.
  2. Tap (+) → Create expense → Scan tab. Upload a receipt image, wait for SmartScan to fill in the fields, then submit.
    Verify: the details page shows the receipt photo at the top and the scanned amount; the expense row shows a receipt thumbnail.
  3. Tap (+) → Track distance. The Map tab is selected by default. Add two waypoints (a start and end address), then submit. (While editing a waypoint you can optionally tap "Use current location" and allow the location prompt to fill in your current address.)
    Verify: the details page shows a map with the route; the expense row shows a car icon.
  4. Tap (+) → Track distance, then switch to the Manual tab. Type a distance, then submit.
    Verify: the amount equals distance × rate; the expense row shows a car icon; the details page shows Distance and Rate fields.
  5. Tap (+) → Track distance, then switch to the Odometer tab. Enter start and end odometer readings, add photos, then submit.
    Verify: the details page shows the two odometer photos, and the distance equals end minus start.
  6. Tap (+) → Track distance, then switch to the GPS tab. Tap Start tracking — when prompted, allow location access (you may get two or three prompts in a row; allow all of them). Move around for at least ~30 seconds, tap Stop tracking, then submit.
    Verify: the details page shows the GPS route on a map; the expense row shows a car icon.
  7. Tap (+) → Create expense → Per Diem tab. Pick a destination, dates, and sub-rates, then submit.
    Verify: the expense row shows a calendar icon; the details page shows the destination, date range, and sub-rate breakdown, and the thumbnail shows a calendar icon (not a receipt photo, a blank box, or a cash icon).
  8. Tap (+) → Create expense → Time tab. Enter hours and a rate, then submit.
    Verify: the expense row shows a clock icon; the details page shows hours × rate.

B. The right fields show, hide, or can be edited on each kind of expense

  1. Open the Distance (Manual) expense from step 4.
    Verify: the Merchant field is not shown (Distance and Rate are shown instead); the Tax field is either not shown, or shown but cannot be edited.
  2. Open the Distance (GPS) expense from step 6.
    Verify: the Amount and Distance fields cannot be tapped to change them; the Rate field can still be changed.
  3. Open the Per Diem expense from step 7.
    Verify: the Tax field is not shown.
  4. Open the Time expense from step 8.
    Verify: the Tax field is not shown.
  5. Open the Scan expense from step 2 and the Manual expense from step 1.
    Verify: on both, the Merchant field is shown and can be edited.

C. GPS and Map distance expenses look different from each other

  1. In the same report, create one Distance (GPS) expense and one Distance (Map) expense — for each, tap the (+) in the chat's message box → Track distance, then pick the GPS or Map tab. Open each one.
    Verify: the GPS expense shows its GPS route with start and end locations; the Map expense shows its waypoints/route; the two look clearly different.
  2. Leave the report and come back to it.
    Verify: both expenses still look correct — the GPS one still shows as GPS, the Map one still shows as Map.

D. Merging keeps the expense kind

  1. Create two Distance (Map) expenses in the same report ((+) in the message box → Track distance → Map tab). Select both and tap Merge. In the merge confirmation, pick a merchant, then tap Confirm.
    Verify: before confirming, the preview still shows a map/route (not a blank box or a cash icon).
  2. Open the merged expense.
    Verify: it is still a distance expense — the map is shown and the Merchant field is hidden.
  3. Leave the report and come back to it.
    Verify: the merged expense still shows the car icon and map.

E. Duplicating keeps the expense kind (a scan becomes a manual expense)

  1. Open a Distance (Map) expense, tap the More (⋮) menu, and tap Duplicate.
    Verify: the duplicate has the car icon and map preview.
  2. Open a Per Diem expense and tap Duplicate.
    Verify: the duplicate has the calendar icon and per-diem breakdown.
  3. Open a Time expense and tap Duplicate.
    Verify: the duplicate has the clock icon and hours breakdown.
  4. Open a Scan expense and tap Duplicate.
    Verify: the duplicate is created as a Manual expense (cash icon, no receipt photo). A duplicated scan does not copy the receipt, so it becomes a regular manual expense.
  5. Duplicate a whole report that contains one scan expense and one distance expense.
    Verify: in the duplicated report, the scan expense is now a Manual expense, and the distance expense is still a Distance expense.

F. Retrying a failed receipt upload keeps it as a scan

  1. Turn on airplane mode (or disconnect the internet). Tap (+) → Create expense → Scan, upload a receipt, and submit.
    Verify: the expense shows a red receipt-upload error.
  2. Turn the internet back on and tap Retry on the error message (re-attach the receipt file if you are asked to).
    Verify: the retried expense is created as a Scan expense (a receipt thumbnail appears) and appears in the report — it must not turn into a plain cash/manual expense.

  • Verify that no errors appear in the JS console

Offline tests

Same as tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android-Native.mp4
Screenshot 2026-05-25 at 6 46 20 PM
Android: mWeb Chrome Screenshot 2026-05-25 at 6 48 47 PM
iOS: Native Screenshot 2026-05-25 at 6 41 59 PM
iOS: mWeb Safari Screenshot 2026-05-25 at 6 42 45 PM
MacOS: Chrome / Safari
Mac-Chrome.mp4

@TaduJR TaduJR requested review from a team as code owners April 19, 2026 15:03
@melvin-bot melvin-bot Bot requested review from mananjadhav and trjExpensify and removed request for a team April 19, 2026 15:03
@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented Apr 19, 2026

@mananjadhav 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]

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d944b76967

ℹ️ 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".

Comment thread src/libs/TransactionUtils/index.ts Outdated
@TaduJR
Copy link
Copy Markdown
Contributor Author

TaduJR commented Apr 19, 2026

@codex review

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2026

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.

Files with missing lines Coverage Δ
...c/components/ReportActionItem/MoneyRequestView.tsx 75.61% <100.00%> (ø)
src/libs/MergeTransactionUtils.ts 78.87% <100.00%> (+0.09%) ⬆️
src/libs/TransactionUtils/index.ts 87.66% <100.00%> (-0.86%) ⬇️
src/libs/actions/IOU/Duplicate.ts 91.64% <100.00%> (+0.02%) ⬆️
src/libs/actions/IOU/MoneyRequest.ts 76.92% <ø> (-0.24%) ⬇️
src/libs/actions/IOU/MoneyRequestBuilder.ts 84.35% <100.00%> (+0.21%) ⬆️
src/libs/actions/IOU/Split.ts 75.70% <100.00%> (+0.04%) ⬆️
src/libs/actions/IOU/TrackExpense.ts 81.04% <100.00%> (+0.32%) ⬆️
src/libs/actions/MergeTransaction.ts 67.89% <100.00%> (+4.73%) ⬆️
.../request/step/confirmation/useExpenseSubmission.ts 53.74% <100.00%> (+0.20%) ⬆️
... and 2 more
... and 71 files with indirect coverage changes

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3688075a47

ℹ️ 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".

Comment thread src/libs/TransactionUtils/index.ts
@TaduJR TaduJR marked this pull request as draft April 20, 2026 04:48
…nsactions-Always-use-iouRequestType-to-check-for-request-type
@TaduJR TaduJR marked this pull request as ready for review April 20, 2026 06:47
Comment thread src/libs/actions/IOU/TrackExpense.ts Outdated
Comment thread src/libs/actions/IOU/index.ts Outdated
@trjExpensify
Copy link
Copy Markdown
Contributor

PR doesn’t need product input as a code clean-up PR. Unassigning and unsubscribing myself.

@trjExpensify trjExpensify removed their request for review April 20, 2026 10:35
TaduJR added 2 commits April 28, 2026 21:11
…nsactions-Always-use-iouRequestType-to-check-for-request-type

# Conflicts:
#	src/components/ReportActionItem/MoneyRequestView.tsx
#	src/components/ReportActionItem/TripRoomPreview.tsx
#	src/components/Search/SearchList/ListItem/ExpenseReportListItemRow.tsx
#	src/libs/TransactionUtils/index.ts
#	src/pages/settings/InitialSettingsPage.tsx
#	src/pages/settings/Wallet/ExpensifyCardPage/index.tsx
#	src/pages/workspace/rules/SpendRules/SpendRulePageBase.tsx
#	src/pages/workspace/rules/SpendRules/SpendRulesSection.tsx
@TaduJR
Copy link
Copy Markdown
Contributor Author

TaduJR commented May 22, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 402ae74ee1

ℹ️ 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".

Comment thread src/libs/TransactionUtils/index.ts
@TaduJR
Copy link
Copy Markdown
Contributor Author

TaduJR commented May 22, 2026

@TaduJR I can see most of the screencasts for tests are not uploaded? Can you please take care of them?

Sure, I wanted to receive feedbacks on code first, before recording for all, but Android Native is already recorded.

Adding the rest now.

@TaduJR
Copy link
Copy Markdown
Contributor Author

TaduJR commented May 25, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb05eca08c

ℹ️ 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".

Comment thread src/libs/TransactionUtils/index.ts
@TaduJR
Copy link
Copy Markdown
Contributor Author

TaduJR commented May 25, 2026

@TaduJR I can see most of the screencasts for tests are not uploaded? Can you please take care of them?

Added demo for desktop and android native and screenshot for the rest of platforms.

We can continue.

@mananjadhav
Copy link
Copy Markdown
Collaborator

Thanks @TaduJR. I'll take a look tomorrow.

currentUserAccountID: params.currentUserAccountIDParam,
existingTransaction: {
...(params.transactionParams ?? {}),
iouRequestType: getDuplicateRequestType(transaction),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see this being duplicated quite a few times.

},
});

splitTransaction.iouRequestType = receipt?.source ? CONST.IOU.REQUEST_TYPE.SCAN : CONST.IOU.REQUEST_TYPE.MANUAL;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're building splitTransaction just before this line. Any reason why this isn't added there?

Copy link
Copy Markdown
Collaborator

@mananjadhav mananjadhav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment on repetitive object creation. Starting to test, can be done in parallel.

@mananjadhav
Copy link
Copy Markdown
Collaborator

mananjadhav commented May 26, 2026

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Stagiang and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
android-iou-request-type.mov
android-iou-request.mov
Android: mWeb Chrome
mweb-chrome-iourequesttype.mov
iOS: HybridApp
iOS: mWeb Safari
mweb-safari-iourequestype.mov
MacOS: Chrome / Safari
web-iou-request-type.mov

Copy link
Copy Markdown
Collaborator

@mananjadhav mananjadhav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issues with my iOS build. But added one final comment.

@melvin-bot melvin-bot Bot requested a review from NicolasBonet May 26, 2026 19:43
@NicolasBonet
Copy link
Copy Markdown
Contributor

NicolasBonet commented May 27, 2026

@codex review

@mananjadhav can you confirm all the 25 testing steps were taken?

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ 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".

@mananjadhav
Copy link
Copy Markdown
Collaborator

@mananjadhav can you confirm all the 25 testing steps were taken?

Yes I did. Generally we test all the steps fully and then a few others. But uploading a subset of the steps. Do you want me to upload them again?

@NicolasBonet NicolasBonet merged commit d9bde6b into Expensify:main May 28, 2026
59 of 65 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🚧 @NicolasBonet has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify
Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/NicolasBonet in version: 9.3.89-1 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@MelvinBot
Copy link
Copy Markdown
Contributor

🤖 Help site review: no docs updates required.

This PR is an internal refactor + bug fix — every user-facing behavior it touches is preserved, not changed, so no App/docs/articles content goes stale.

What the PR changes vs. what's documented

The PR's changes are code-level only:

  • is{Type}Request() utilities now read iouRequestType directly (since Auth#19725 now sends it on every transaction). Dead fallback logic and the gps_start/gps_stop waypoint hack are removed.
  • MergeTransaction.ts no longer writes iouRequestType: null during distance merges (bug fix preserving the existing "merging two distance expenses keeps the distance type" behavior).
  • RequestMoneyInformation/CreateTrackExpenseParams now carry an explicit existingTransaction so isScanRequest can identify retried scans correctly (bug fix preserving the existing "retrying a failed scan stays a Scan" behavior).
  • Duplicate flow extracts getDuplicateRequestType() to coerce SCAN → MANUAL — this is the same behavior already documented at How-to-Duplicate-an-Expense.md ("Duplicate is unavailable while a receipt is being scanned" / "Receipt images are not copied").
  • startSplitBill and buildMergedTransactionData now stamp iouRequestType correctly on optimistic/merged transactions (bug fixes preserving existing behavior).

No new UI, no new buttons/tabs/settings, no flow changes:

  • (+) → Create expense → Manual / Scan / Per Diem / Time tabs — unchanged
  • (+) → Track distance → Map / Manual / Odometer / GPS tabs — unchanged
  • Merge / Duplicate / Retry flows — unchanged from the user's perspective

The PR's own Tests section (A–F) is a regression suite confirming the existing documented behavior still works after the refactor — it does not describe new functionality.

@TaduJR, since there's nothing to publish, no draft docs PR was created. If you spot a user-visible change I missed, reply with @MelvinBot and point it out and I'll open a draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants