Vydia / react-native-background-upload

Upload files in your React Native app even while it's backgrounded. Supports Android and iOS, including camera roll assets.
MIT License
726 stars 332 forks source link

startUpload calls reject twice if copyAssetToFile fails #161

Open maxschmeling opened 5 years ago

maxschmeling commented 5 years ago

When attempting to startUpload with a assets-library file, if copyAssetToFile fails, reject is called two times.

It is first called in the copyAssetToFile completion handler: https://github.com/Vydia/react-native-background-upload/blob/a4f2fa45003fcf01bec75324aafd5ee472365b26/ios/VydiaRNFileUploader.m#L182

And then again in the catch after the continued attempt to upload directly from the assets-library path fails: https://github.com/Vydia/react-native-background-upload/blob/a4f2fa45003fcf01bec75324aafd5ee472365b26/ios/VydiaRNFileUploader.m#L216