From a0468100fe8d901f0f4ca3a2958afab791c45a18 Mon Sep 17 00:00:00 2001 From: Deepak Yadav <76097094+deepktp@users.noreply.github.com> Date: Mon, 24 Mar 2025 14:50:39 +0530 Subject: [PATCH] fix: Download complete promise never resolve issue and invalid total value returned in progress fix for file size 2GB+ --- .../Response/ReactNativeBlobUtilFileResp.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilFileResp.java b/android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilFileResp.java index 81bbd0852..8291b84fc 100644 --- a/android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilFileResp.java +++ b/android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilFileResp.java @@ -72,10 +72,19 @@ public MediaType contentType() { @Override public long contentLength() { - if (originalBody.contentLength() > Integer.MAX_VALUE) { + + /** + * + * Okio buffer issue in current version seems to be fixed in the latest versions + * + * limiting this was causing the download progress to stop at 2GB size but files still was downloading + * + */ + + // if (originalBody.contentLength() > Integer.MAX_VALUE) { // This is a workaround for a bug Okio buffer where it can't handle larger than int. - return Integer.MAX_VALUE; - } + // return Integer.MAX_VALUE; + // } return originalBody.contentLength(); }