Skip to content

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

Description

@msluszniak

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 ([RNE Rewrite] Resource fetcher: misleading progress, slow large-file downloads, no iOS background download #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 #1369 (comment). #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.

Activity

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

Metadata

Metadata

Assignees

Labels

3rd party packageIssue related to 3rd party packages, but not ExecuTorch, e.g. ExpoblockedIssue blocked by some problems (but not other issue, use relationship -> blocker instead)platform: androidIssues and tasks related to Androidrefactoring

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions