Skip to content

The UploadData method in React Native causes the app to freeze or lag because the blob loads the entire file into RAM #14596

@ManojAtamai

Description

@ManojAtamai

Before opening, please confirm:

JavaScript Framework

React Native

Amplify APIs

Storage

Amplify Version

v6

Amplify Categories

storage

Backend

None

Environment information

# Put output below this line

 System:
    OS: macOS 15.1.1
    CPU: (11) arm64 Apple M3 Pro
    Memory: 796.23 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.18.0 - /Users/xxx/.nvm/versions/node/v20.18.0/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.8.2 - /Users/xxx/.nvm/versions/node/v20.18.0/bin/npm
    Watchman: 2025.02.10.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 141.0.7390.108
    Safari: 18.1.1
  npmGlobalPackages:
    corepack: 0.29.3
    eas-cli: 12.6.2
    npm: 10.8.2

Describe the bug

I am noticing the application freezing or lagging during uploads are in progress

Expected behavior

Application should not freeze

Reproduction steps

  1. I am starting a background thread using the react-native-background-actions npm package.
  2. I am uploading more than 100 images sequentially to S3 storage.

Code Snippet

// Put your code below this line.
const response = await fetch(documentDirectoryFilePath);
const data = await response.blob();
uploadData({
        path: ({ identityId }) => `protected/${identityId}/${key}`,
        data: dataPayload as any,
        options: {
          useAccelerateEndpoint: true,
          contentType: vehicleMedia.mimeType,
          metadata: metaData,
        },
      });

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionGeneral question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions