numandev1 / react-native-compressor

🗜️Compress Image, Video, and Audio same like Whatsapp 🚀✨

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"software caused connection abort" error on long backgroundUpload

rflorence opened this issue · comments

Current behavior

When uploading a large file with slow network speed and the phone screen turned off, the backgroundUpload stops and throws a "software caused connection abort" error after 1-2 minutes. It works if I keep the app active.

Expected behavior

Long uploads work in the background if the app is in the background or phone screen is turned off.

Platform

  • Android
  • haven't tried iOS

React Native Version

0.72.7

React Native Compressor Version

1.8.21

Reproducible Steps And Demo

Here's how I'm calling backgroundUpload to upload to a presigned S3 URL:

const uploadResponse = await backgroundUpload(
      url,
      fileUrl,
      {
        httpMethod: 'POST',
        fieldName: 'file',
        mimeType: 'video/mp4',
        parameters: presignedS3Fields,
        uploadType: UploadType.MULTIPART
      },
      (written, total) => console.log(written, total),
      signal
    )

I've been using this Android app to throttle my internet connection to simulate 4G.

👋 @rflorence
Thanks for opening your issue here! If you find this package useful hit the star🌟!