numandev1 / react-native-compressor

🗜️Compress Image, Video, and Audio same like Whatsapp 🚀✨
MIT License
948 stars 91 forks source link

"software caused connection abort" error on long backgroundUpload #247

Open rflorence opened 1 year ago

rflorence commented 1 year ago

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

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.

github-actions[bot] commented 1 year ago

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

github-actions[bot] commented 9 hours ago

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.