Skip to content

Bump react-native-blob-util to 1.1.1 - #108665

Merged
roryabraham merged 3 commits into
Expensify:mainfrom
software-mansion-labs:@mbert/bump-blob
Dec 3, 2026
Merged

roryabraham merged 3 commits into
Expensify:mainfrom
software-mansion-labs:@mbert/bump-blob

Conversation

@m-bert

@m-bert m-bert commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Bumps react-native-blob-util from 0.24.12 to 1.1.1, which ships its own Package.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: addAndroidDownloads became android.downloadManager, and path() can now return null.
  • saveLocalFileToGallery.android.ts and localFileDownload/index.android.ts: MediaCollection.copyToMediaStore became media.copyToMediaStore, and mimeType became mime. We still send null when the MIME type is unknown, so Android works it out from the file name. The library's types don't allow null, hence the type assertion.
  • One test mock: fs.slice no longer resolves a value.

The HybridApp Podfile.lock is 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.

  1. Open any chat, tap + in the composer, then Add attachment > Choose file, and pick a PDF. Verify the PDF is sent and its preview shows in the chat.
  2. Tap the PDF in the chat. Verify it opens and all its pages can be scrolled.
  3. Tap the download button in the PDF's header. Verify the "Downloaded!" message appears. On Android, also verify the file is in the Download/Expensify folder.
  4. Tap + > Add attachment > Choose from gallery and pick an image. Verify the image is sent and shows in the chat.
  5. Tap + > Create expense > Scan, choose a receipt image from the gallery and create the expense. Verify the expense is created with the receipt.
  6. Open that expense, tap the receipt and tap the rotate button. Verify the receipt turns 90°.
  7. Close the receipt and open it again. Verify it is still rotated.
  8. Open Insights, open the three-dot menu on any chart and tap Download CSV. Verify on Android that the "Downloaded!" message appears and the CSV is in the Download folder. Verify on iOS that the share sheet opens with the CSV.
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

Same as tests.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

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

@m-bert
m-bert requested review from a team as code owners December 2, 2026 14:57
Copilot AI balanced review requested due to automatic review settings December 2, 2026 14:57
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

⚠️ This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. ⚠️

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T15:15:58.135039Z b36bb01 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@expensify-chore-bot

Copy link
Copy Markdown

@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]

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

codecov Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
...ibs/fileDownload/saveLocalFileToGallery.android.ts 100.00% <100.00%> (+100.00%) ⬆️
src/libs/fileDownload/index.android.ts 0.00% <0.00%> (ø)
src/libs/localFileDownload/index.android.ts 0.00% <0.00%> (ø)
... and 8 files with indirect coverage changes

@huult

huult commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Screen.Recording.2026-12-03.at.15.09.40.mp4
Android: mWeb Chrome
Screen.Recording.2026-12-03.at.15.16.23.mov
iOS: HybridApp
Screen.Recording.2026-12-03.at.14.44.30.mp4
Screen.Recording.2026-12-03.at.14.48.22.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-12-03.at.15.17.46.mov

@samranahm

Copy link
Copy Markdown
Contributor

@huult is reviewing this PR, removing my assignment.

@samranahm
samranahm removed their request for review December 2, 2026 15:28
@ahmedGaber93

ahmedGaber93 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

@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.

@ahmedGaber93
ahmedGaber93 removed their request for review December 2, 2026 17:43
@samranahm

Copy link
Copy Markdown
Contributor

Yup! this make sense, I'll start a slack thread where we can track each PR.

@trjExpensify

Copy link
Copy Markdown
Contributor

PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself.

@trjExpensify
trjExpensify removed their request for review December 2, 2026 23:22
// 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),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@huult

huult commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

@m-bert could you add an Android test to verify that copyToMediaStore is called with the correct MIME type?

@m-bert

m-bert commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

@m-bert could you add an Android test to verify that copyToMediaStore is called with the correct MIME type?

Is 4a8e7b4 what you meant, @huult?

@huult huult left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@melvin-bot
melvin-bot Bot requested a review from roryabraham December 3, 2026 15:49
@roryabraham
roryabraham merged commit 2e081b4 into Expensify:main Dec 3, 2026
58 of 60 checks passed
@OSBotify

OSBotify commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants