[CP Staging] fix: share sheet upload edited receipt and keep Category after upgrade#88095
Conversation
…gory visible after upgrade
|
@hoangzinh 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-04-17.at.05.59.26.moviOS: HybridAppScreen.Recording.2026-04-17.at.06.08.12.mov |
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.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6390d2361c
ℹ️ 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".
…sion is pre-granted
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1fe8165f6
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ 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". |
|
@MelvinBot, please review this PR |
|
🤖 Code Review Overall this is a well-structured PR that fixes real deploy blockers with clean patterns (extracting 1. In if (size > CONST.API_ATTACHMENT_VALIDATIONS.MAX_SIZE) {
setErrorTitle(translate('attachmentPicker.attachmentTooLarge'));
setErrorMessage(translate('attachmentPicker.sizeExceeded'));
} else if (size < CONST.API_ATTACHMENT_VALIDATIONS.MIN_SIZE) {
setErrorTitle(translate('attachmentPicker.attachmentTooSmall'));
setErrorMessage(translate('attachmentPicker.sizeNotMet'));
} else {
setErrorTitle(undefined);
setErrorMessage(undefined);
}2. At 3.
4.
Nits (non-blocking)
None of these are merge blockers. The core fixes for #88068, #88045, and #88100 look correct and well-motivated. Item 1 (error not clearing on Replace) is the most impactful to address before merge. |
There was a problem hiding this comment.
@TaduJR can you follow up with creating robust unit tests for this?
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
…flow-to-native-share-sheet-creation-flow [CP Staging] fix: share sheet upload edited receipt and keep Category after upgrade (cherry picked from commit a23ae1b) (cherry-picked to staging by mountiny)
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.3.60-12 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. The changes are internal bug fixes and a code refactor in the native share sheet flow (receipt replacement, category visibility after upgrade, iOS location permission handling, and shared file-size validation). None of these introduce new user-facing features, rename UI elements, or alter documented behavior — the help site has no articles covering the native share sheet flow. |
Explanation of Change
Fixes four deploy blockers from #87142 in the native share sheet flow:
All exposed by UI surfaces #87142 newly enabled inheriting broken downstream reads or missing gates except #88100.
#88068
onConfirmwas reading fromcurrentAttachment(frozen original file). Now reads fromtransaction.receipt(which Replace/Crop updates), with fallback to the original.#88045
SubmitDetailsPagepassedpolicyIDfromuseOnyx(POLICY + report?.policyID). For self-DM,report?.policyID === "_FAKE_", so the subscription never resolved to a real workspace after upgrade. Now usesusePolicyForTransaction(same hookMoneyRequestConfirmationListuses internally), which returns the active workspace for self-DM track expenses.Also added
!!iouCategoryto the track branch ofshouldShowCategoriesinMoneyRequestConfirmationList— one-line consistency fix matching the non-track branch's existing safeguard, so a selected category stays visible while categories load.#88100
PR changed
onGrant={onConfirm}toonGrant={() => onConfirm(undefined, true)}, which re-enteredonConfirmwithgpsRequired=true. On iOS with permission pre-granted,LocationPermissionModalfiresonGrantimmediately — the re-entry hit the same "permission flow" branch,setStartLocationPermissionFlow(true)was a no-op (state already true), and the button stayed dead. Extracted aperformUpload(participant, locationPermissionGranted)helper (mirrorsIOURequestStepConfirmation'screateTransactionpattern); modal callbacks now call it directly with the correct location flag instead of re-enteringonConfirm.Enhancement
SubmitDetailsPagehad no file-size validation whileShareDetailsPagedid. Extracted the shared logic into a newuseShareFileSizeValidationhook and wired both consumers to it — Submit flow now shows the same "too large / too small" error as the Share flow.Fixed Issues
$ #88068
$ #88045
$ #88100
PROPOSAL:
Tests
Test 1: Replace receipt (#88068)
Test 2: Crop receipt (#88068)
Test 3: Category visible after upgrade in self-DM (#88045)
Precondition: Account does NOT have a workspace.
!policyis true)Test 4: Large file size validation in Submit flow
Test 5: Create expense button responsive with location permission pre-granted (#88100)
Precondition: Expensify already has location permission granted at the OS level (iOS).
Offline tests
Same as tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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