kesha-antonov / react-native-background-downloader

About A library for React-Native to help you download large files on iOS and Android both in the foreground and most importantly in the background.
https://www.npmjs.com/package/@kesha-antonov/react-native-background-downloader
Other
55 stars 11 forks source link

Download stays locked in pending when provided slow responding download link #22

Open Cereser01 opened 5 months ago

Cereser01 commented 5 months ago

Is this a bug report, a feature request, or a question?

Bug

Have you followed the required steps before opening a bug report?

Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?

I've only experienced and been able to reproduce it on Android.

Is the bug related to the native implementation? (NSURLSession on iOS and Fetch on Android)

Not that I've been able to detect.

Environment

Environment: React: 18.2.0 React native: 0.74.0 react-native-background-downloader: ^3.1.2 Node: 18 Java: 17

Target Platform: Android (34.0)

Expected Behavior

The file should correctly download after the URL responds.

Actual Behavior

The download is permanently in a state of "Pending" and never finishes.

Steps to Reproduce

The following repository contains a basic app to recreate the issue: https://github.com/Cereser01/wdvcamerapoc

How to reproduce using the app from the above repository:

  1. Pull the code from the above repository.
  2. Run npm install.
  3. Run react-native run-android (if using McAfee Anti-virus, add --port=1234)
  4. Click "Toggle Job URL" so that the "Problematic URL" is selected.
  5. Press "Attempt download"
  6. Note that parameters are correctly being fed into the 'download' function from react-native-background-downloader
  7. Note that the download will forever stay at a pending state.

How to reproduce from scratch:

  1. Create an app and install react-native-background-downloader.
  2. Import {download} from '@kesha-antonov/react-native-background-downloader'.
  3. Feed the url https://www.weg.net/campaigns/dw/ to the download function.
  4. Run the function.
  5. Note that the download will forever stay at a pending state.

Relevant information

The problematic URL takes 2 to 6 minutes to respond after being called.

RanderGabriel commented 1 month ago

I am having the same problem. Cereser01, were you able to resolve the issue?