-
Notifications
You must be signed in to change notification settings - Fork 152
iOS: Some files are saved with 0 KB size when IOSBackgroundTask: true #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is the app in the background when the downloads finish? What happens if you don't use the file cache? I'm wondering if it maybe downloads the file but since the app is not active it stops the processing and does not handle the finished download correctly |
Hi @RonRadtke , thanks for the reply. Let me try to answer your questions: 1. Is the app in the background when the downloads finish? 2. Do you get a positive response for these files that have 0 bytes? 3. What happens if you don't use the file cache? 4. I'm wondering if it maybe downloads the file but since the app is not active it stops the processing and does not handle the finished download correctly Also, it's strange that the response from react-native-blob-utils is success and valid even if the file was not properly created. I think in this case, something got stuck in the layer between react-native-blob-utils and iOS native, but I'm not sure. |
Uh oh!
There was an error while loading. Please reload this page.
Hi, I'm using
react-native-blob-util
in a React Native CLI app to download multiple files in parallel. The downloads work perfectly whenIOSBackgroundTask
is set tofalse
, but when I setIOSBackgroundTask: true
, I consistently encounter a problem: some of the downloaded files end up being 0 KB in size, and it's not always the same file. The issue appears to occur randomly.Can someone help me understand why this is happening, and when should I set IOSBackgroundTask to true? The App I'm building has a requirement to work Offline, that's why I have to download multiple files and store them. It also need to keep downloading the files even when the App is running on background.
Environment:
Library version: react-native-blob-util@^0.19.11
React Native version: 0.76.9
Platform: iOS
Device: Simulator (tested so far)
iOS Version: e.g., iOS 17.5 (simulator)
Development machine: macOS
Steps to reproduce:
Configure the fetch call with IOSBackgroundTask: true.
Initiate multiple file downloads in parallel (e.g., 5–10).
Observe that some files are saved with 0 KB size.
Repeat test — different files result in 0 KB on each run.
Sample Code
Screenshot
The text was updated successfully, but these errors were encountered: