Fix: use converted JPEG for HEIC receipts on Submit share tab#96232
Fix: use converted JPEG for HEIC receipts on Submit share tab#96232MelvinBot wants to merge 2 commits into
Conversation
Co-authored-by: thelullabyy <thelullabyy@users.noreply.github.com>
…e tab Co-authored-by: thelullabyy <thelullabyy@users.noreply.github.com>
|
I looked into the failing checks. There's no code-level failure to fix — every functional check now passes:
The only red check is
That check just requires the checklist boxes in the PR description to be ticked and the To get this check green, |
Explanation of Change
On iOS, sharing a HEIC image into the app and using the Submit tab created the expense but failed to attach the receipt — the backend rejected it with
Unsupported file type: image/heic. The chat Share tab worked because it uploads the converted JPEG.SubmitDetailsPagealready computes the branch-awarefileUri/fileName/fileType, which resolve to the converted JPEG (fromVALIDATED_FILE_OBJECT) for shares that need conversion, and to the raw attachment otherwise. But it then re-derivedsharedFileSource/sharedFileName/sharedFileTypefromcurrentAttachmentwith?? fileUrifallbacks. SincecurrentAttachment.content/.mimeTypeare always populated for a shared file, those fallbacks were dead code and the raw.heicpath/image/heictype always won — flowing into the seeded receipt andperformUpload→readFileAsync.This change:
fileUri/fileName/fileTypedirectly for the receipt source/name/type, mirroringShareDetailsPage. Non-HEIC shares are unchanged (therefileUri === currentAttachment.content).performUploaduntil the async conversion has landed inVALIDATED_FILE_OBJECTfor shares that need validation (shouldUsePreValidatedFile && !validFilesToUpload), so a fast tap can't submit the raw file. The early return keeps clearingisConfirmingso the button isn't stuck and a retry succeeds once the JPEG is ready.Added regression tests in
tests/ui/SubmitDetailsPageTest.tsxcovering both the converted-upload behavior and the confirm guard.Fixed Issues
$ #95824
PROPOSAL: #95824 (comment)
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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