Repository navigation
Bump react-native-blob-util to 1.1.1 - #108665
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. |
|
@huult @ahmedGaber93 @samranahm One of you needs to 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] |
There was a problem hiding this comment.
🔵 Needs a closer look
The Kotlin/Swift rewrite requires native build/runtime validation, while the inaccessible companion PR leaves HybridApp integration and lockfile compatibility unverified.
No open issues 🎉
What changed in this PR
Upgrades react-native-blob-util to 1.1.1 to support the planned Swift Package Manager migration.
Changes:
- Updates the dependency and npm/iOS lockfiles.
- Migrates Android download and MediaStore calls to the new API.
- Adjusts the file-slicing mock and removes an outdated Gradle comment reference.
| File | Description |
|---|---|
tests/unit/getMimeTypeFromFileHeaderTest.ts |
Updates the mock for fs.slice returning no value. |
src/libs/localFileDownload/index.android.ts |
Migrates MediaStore calls and the MIME option. |
src/libs/fileDownload/saveLocalFileToGallery.android.ts |
Migrates MediaStore calls while preserving null MIME handling. |
src/libs/fileDownload/index.android.ts |
Updates DownloadManager configuration and handles nullable paths. |
package.json |
Pins version 1.1.1. |
package-lock.json |
Records the updated dependency metadata. |
ios/Podfile.lock |
Updates the pod version and checksum. |
android/gradle.properties |
Removes the library from a legacy-DSL comment; configuration is unchanged. |
Review effort: Balanced
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-12-03.at.15.09.40.mp4Android: mWeb ChromeScreen.Recording.2026-12-03.at.15.16.23.moviOS: HybridAppScreen.Recording.2026-12-03.at.14.44.30.mp4Screen.Recording.2026-12-03.at.14.48.22.mp4iOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-12-03.at.15.17.46.mov |
|
@huult is reviewing this PR, removing my assignment. |
|
@huult @samranahm Since all three of us are assigned to this issue, can we take turns reviewing these? @huult can take this one, I'll review the next one, and @samranahm can take the one after that. Then we can keep rotating in that order. |
|
Yup! this make sense, I'll start a slack thread where we can track each PR. |
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
| // The native side rejects a descriptor without a MIME type key, and takes null as "let the Media Store work it out". | ||
| // An undefined value is dropped on the way to native code, so null is sent although the library's types leave it out. | ||
| // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- the library's types don't allow the null its native side accepts | ||
| mime: mimeType ?? (null as unknown as undefined), |
There was a problem hiding this comment.
| mime: mimeType ?? (null as unknown as undefined), | |
| mime: mimeType ?? getMimeType(fileExtension), |
@m-bert can we use this?
const name = fileName ?? getFileName(localPath);
const {fileExtension} = splitExtensionFromFileName(name);
...
mime: mimeType ?? getMimeType(fileExtension),There was a problem hiding this comment.
I'd rather keep null here. getMimeType only knows txt, csv, pdf, html, xml and zip, and returns application/octet-stream for everything else, so we would pass that type for images and videos, which is most of what is saved through this function.
With null, Android works the type out from the file name: in my tests the saved files were recorded as image/png, video/mp4 and application/pdf. That is also what main does today (mimeType: mimeType ?? null), so this PR doesn't change the behaviour. The assertion is only there because the library's types don't allow null.
Let me know if you agree.
|
@m-bert could you add an Android test to verify that copyToMediaStore is called with the correct MIME type? |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 roryabraham 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! 🧪🧪
|
Explanation of Change
Bumps
react-native-blob-utilfrom 0.24.12 to 1.1.1, which ships its ownPackage.swift. We need that for the move from CocoaPods to Swift Package Manager (#96908).This is a major version bump: 1.0 rewrote the native code in Kotlin and Swift and renamed some Android options (the old names are deprecated). Our code changes for it are all Android-only:
fileDownload/index.android.ts:addAndroidDownloadsbecameandroid.downloadManager, andpath()can now returnnull.saveLocalFileToGallery.android.tsandlocalFileDownload/index.android.ts:MediaCollection.copyToMediaStorebecamemedia.copyToMediaStore, andmimeTypebecamemime. We still sendnullwhen the MIME type is unknown, so Android works it out from the file name. The library's types don't allownull, hence the type assertion.fs.sliceno longer resolves a value.The HybridApp
Podfile.lockis updated in the companion Mobile-Expensify PR.Fixed Issues
$ #96908
PROPOSAL: N/A
MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/14285
Tests
Run on the Android and iOS apps.
Download/Expensifyfolder.Downloadfolder. Verify on iOS that the share sheet opens with the CSV.Offline tests
N/A
QA Steps
Same as tests.
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
Screen.Recording.2026-12-02.at.15.21.12.mov
Android: mWeb Chrome
iOS: Native
Screen.Recording.2026-12-02.at.15.22.51.mov
iOS: mWeb Safari
MacOS: Chrome / Safari