fix: Block raw HEIC upload when conversion fails - #96024
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
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.
|
|
@annaweber830 how is it looking? |
I am preparing PR and I will prepare today or tomorrow. |
|
@annaweber830 where is the case of heic upload failure in the test steps. For me when I try to upload a 15MB heic it fails which you can use in the test step. Also record screenshots pls. |
|
Hi @FitseTLT, thanks! Could you please share a 15 MB HEIC image? |
You will have to download large img and online convert it to heic on your emulators web browser that's how you can make the file available on the emulators. |
|
Hi @FitseTLT I updated PR. |
|
Ok also add android native snapshots and also update the test steps accordingly |
|
@joekaufmanexpensify @mountiny can you guys confirm the text that is displayed in the modal is? U can see the ios native snapshot in the OP for reference. |
|
Hi @FitseTLT I updated PR. |
Why don't you update the test steps accordingly for the case that shows the modal? I am asking it for the third time |
|
Hi @FitseTLT Sorry I confused. I updated PR. |
It would be nice if you add the exact heic img that caused the modal to appear in the steps otherwise large file can be ambigious. |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for Product
|
@joekaufmanexpensify can you confirm the text in the modal is correct when the heic file conversion fails ?
|
|
Hi @FitseTLT |
Yeah but for me a 15 MB heic img always fails and my recommendation worked for you (I suppose you are also using a large file) What I am saying is it would be easy for the QA to give them a clear step and otherwise they can't test this case of heic conversion failure. Can u attach the img you are using for testing? |
|
Hi @FitseTLT thanks for response. |
|
Hi @FitseTLT I updated test steps. |
|
@annaweber830 Note: HEIC conversion failure is intermittent — it may take multiple attempts. When it fails, verify the error modal appears and the upload is blocked (no raw .heic is uploaded). Go to FAB -> Create expense -> Scan. |
|
Hi @FitseTLT I udpated my PR. |
|
That is fair, do we have a way to know it was just one/some from those uploaded that failed when showing the error? |
Hi @mountiny I'll check and see if we can identify which of the uploaded files failed when the error is shown. |
It is a gap in the current main that it displays error modals then it will navigate you to the next page if there are successful files. So it is not a gap our pr introduced but I only have a doubt that our error text is a bit misleading. I want to know your direction on that @mountiny |
Yes, we can. The conversion callback knows which file failed; we just need to pass that filename into the error state and display it in the modal. |
btw there can be multiple files failing and also the other error copies also can be displayed which have the same problems. But at least we can make our error text to not seem like there is only one img failing by making it more general. |
mountiny
left a comment
There was a problem hiding this comment.
I think we can handle that separately
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.52-0 🚀
|
|
🤖 I reviewed this PR against Expensify's help site files under Why: This is an internal error-handling fix. When a HEIC image fails to convert, the app now blocks the raw What I checked
Since HEIC support is not a documented feature and the change is limited to failure-path error handling, there is no help-site content that becomes inaccurate as a result of this PR. If you'd still like a proactive doc note added (e.g. calling out image-format guidance for receipt uploads), let me know and I'll draft one. |
|
Hi @annaweber830. QA team failed this PR for iOS with the original issue; the HEIC image was uploaded without a modal error being shown 1786460263363.GALLERY.mp4 |
Nope @IuliiaHerets we clearly stated on the steps that the failing only happens intermittently and if it doesn't fail it should create a successful expense. that's the change 👍 |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.52-11 🚀
Bundle Size Analysis (Sentry): |

Explanation of Change
Fixed Issues
$ #95825
PROPOSAL: #95825 (comment)
Tests
Pre-requisite: download test.zip — a HEIC that triggers conversion failure.
Note: HEIC conversion failure is intermittent — it may take multiple attempts. When it fails, verify the error modal appears and the upload is blocked (no raw .heic is uploaded).
Offline tests
Same as test
QA Steps
Pre-requisite: download test.zip — a HEIC that triggers conversion failure.
Note: HEIC conversion failure is intermittent — it may take multiple attempts. When it fails, verify the error modal appears and the upload is blocked (no raw .heic is uploaded).
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
issue-95825-fixed-compressed.mp4
Android: mWeb Chrome
expensify-recording-2-compressed.mp4
iOS: Native
Screen.Recording.2026-07-15.at.8.23.32.AM.mov
iOS: mWeb Safari
Screen_Recording_2026-07-16_at_9.06.45.PM.mp4
MacOS: Chrome / Safari
Screen_Recording_2026-07-16_at_8.27.27.PM.mp4