software-mansion / software-mansion/react-native-executorch

[RNE Rewrite] Drop the Android DownloadManager fallback once blob-util releases the #475 fix

Open
#1,401 0 comments 0 reactions 1 assignee View on GitHub

@msluszniak is already working on this.

Since Sep 1, 2026.

3rd party package blocked platform: android refactoring
Dominant language
TypeScript
Stars
1.7k
Forks
96
Avg merge
20h 51m
Merged PRs (30d)
59

Description

src/fetcher/fetcher.ts carries three download backends:

  • the optional background downloader (both platforms, when the app installs @kesha-antonov/react-native-background-downloader)
  • the system DownloadManager (Android fallback)
  • a blob-util stream with Range resume (iOS fallback)

The Android one exists for a single reason: blob-util's in-process reader is broken. On 0.24.10 it stops after exactly 8 KB with "Download interrupted" (RonRadtke/react-native-blob-util#475). ProgressReportingSource.read() writes each chunk to the destination file but never into the okio sink it was handed, so buffered consumers see an empty buffer and hit a false EOF after the first segment.

The upstream fix is already merged but not released. PR #474 landed on master on 2026-08-04 (commit f0da45e9) and adds the missing sink.write(...). npm's latest is still 0.24.10, published 2026-06-19, and master is still versioned 0.24.10, so no release carries it yet.

Once a release with that fix is out:

  1. Bump the react-native-blob-util peer range to the fixed version.
  2. Delete downloadUrlViaAndroidDownloadManager and the IS_ANDROID branch in startDownload, so both platforms share one fallback.
  3. Delete reassemble32BitCounter. The 32-bit progress overflow it works around (#1366) comes from DownloadManager's COLUMN_BYTES_DOWNLOADED_SO_FAR being read with getInt; the in-process path reports bytes as a string and does not overflow.
  4. Re-check the Android cache directory. It is the app-private external dir only so DownloadManager could write there, but moving it would invalidate every already-downloaded model, so it should probably stay where it is regardless.
  5. Verify a >2 GB download on device. 0.24.10 rewrote the drain loop specifically to lift OkHttp's 2 GB Integer.MAX_VALUE ceiling, but that has never been exercised end to end because the path has been broken since it landed.

That leaves one mechanism plus one shared fallback, which is what @barhanc asked for in https://github.com/software-mansion/react-native-executorch/pull/1369#discussion_r3904012123. #1369 did the half that was unblocked: the background downloader now backs both platforms, so an app that installs it gets the same behavior on each. This issue is the rest.

Blocked on an upstream release.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.