Repository navigation
Fix sharing HEIC/HEIF files on Android - #106816
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
|
Reviewing... |
|
Sorry. @DylanDylann would you like to review since you're original assignee? |
@mountiny I requested your review if you don't mind since the bug was caught during testing PR you reviewed. Also https://github.com/Expensify/Mobile-Expensify/pull/14229 |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-11-13.at.7.55.01.PM.movAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
Bug: HEIF shares don't get the Submit tab. Prerequisite: a HEIC and a HEIF image on the device. Steps
Expected: the Submit and Share tabs both show, as they do for HEIC. Actual: only the Share tab shows. Sharing the Cause
|
|
@TaduJR please check again now. |
TaduJR
left a comment
There was a problem hiding this comment.
Thanks! Just some minor things
Tests: the converter fix also covers flows outside the Android share sheet. Can we add these to Tests/QA?
- iOS: share a
.heicand a.heiffrom the Files app. The share extension copies file URLs as-is (ShareViewController.swift#L182-L183) and gets the MIME type from the extension (RCTShareActionHandlerModule.m#L81-L82), so both reachconvertHeicImage..heifalso changes behavior on iOS: it used to upload as-is and now gets converted. - iOS and Android: Choose file ->
.heic, in a chat and in Scan. Document-picked.heicfiles go through the same converter (AttachmentPicker/index.native.tsx#L149).
Unit test: can we add a shouldValidateFile({mimeType: 'image/heif'}) case to tests/unit/ReceiptUtilsTest.ts? The unit test box is ticked, but I don't see one in the diff.
Co-authored-by: TaduJR <90861780+TaduJR@users.noreply.github.com>
|
Thanks! All addressed |
|
Thanks! Mind checking this one https://github.com/Expensify/Mobile-Expensify/pull/14229#pullrequestreview-5892474260 |
Updated! |
|
BUG 1: 48 MP HEIC fails to convert Prerequisite: a 48 MP HEIC on the device:
Expected: it converts, and the share screen opens normally. Actual: "We couldn't process this image" appears. Logcat shows BUG 2: Share button does nothing after a failed conversion Prerequisite: a broken HEIC.
Expected: an error or a way back. Actual: nothing happens. The attachment box shows only a paperclip, and nothing is sent. BUG 3: WebP can't be shared on Android Prerequisite: a
Expected: Expensify is listed. Actual: Expensify isn't listed. BUG 4: a Prerequisite: a HEIC copied as
Expected: Actual: All the above one are pre-existing issues found during review. We can work on them after CME reviews all. |
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
JmillsExpensify
left a comment
There was a problem hiding this comment.
Tested on the iOS adhoc. This fixed my issue so approving.
|
🚧 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. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.40-0 🚀
|
|
No help site update needed — this PR fixes HEIC/HEIF sharing and image conversion in existing workflows, restoring expected behavior without making any existing article sentence incorrect. |


Explanation of Change
Android never offered Expensify as a share target for HEIC/HEIF files because neither manifest listed those MIME types.
This adds
image/heicandimage/heifto the share filter (here and in the Mobile-Expensify PR).With that in place, the shared HEIC failed to convert.
convertImageWithManipulatoris an async arrow with a destructured default param, and the Hermes version React Native ships resolves the firstawaitin such functions asundefined(meta/hermes#1761, backport meta/hermes#2030 still open).The callbacks are now a plain param destructured in the body.
Shared HEIF files are also routed through the conversion like HEIC.
Fixed Issues
$ #106387
$ #106879
MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/14229
Tests
Android share sheet
.heicimage.heifimageiOS share extension
.heicimage and tap Share.heifimageChoose file (iOS and Android)
.heicimage.heicimageOffline tests
Same as tests. Verify the attachment and the expense are created offline and sync when back online.
QA Steps
Same as tests (Android only)
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
before.fix.mov
after.fix.mov
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari