itinance / itinance/react-native-fs
RNFS.downloadFile resolves without bytesWritten very often (RNFS v1.5.1)
- Dominant language
- C++
- Stars
- 5k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
react-native v0.33.0
react-native-fs v1.5.1
I make a habit of checking the size-on-disk of each file I download, because I've noticed that sometimes a download operation will produce a truncated file (less than 200 bytes, for a file in Amazon S3 that's 90k).
Lately, I've started relying on the resolution value of `RNFS.downloadFile`, which is documented as containing `jobId`, `bytesWritten`, and `statusCode`. Today I've discovered that `bytesWritten` is often undefined, even though the file downloaded correctly and the `statusCode` is `200`.
I used `RNFS.stat` to verify the result of `RNFS.downloadFile`. Even though `bytesWritten` is undefined, `stat` reports a size of 70k on disk (the correct size).
By "very often," I mean that `bytesWritten` is incorrect 74 times out of 75. I've been building a caching module, and while putting it through its paces I've done nearly 1000 downloads of files around 90k.
Apologies if this is fixed in the newest version of RNFS.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.