Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

100% Upload progress on dev mode only. #6360

Open
ahmed-khlifi opened this issue Apr 17, 2024 · 0 comments
Open

100% Upload progress on dev mode only. #6360

ahmed-khlifi opened this issue Apr 17, 2024 · 0 comments

Comments

@ahmed-khlifi
Copy link

Describe the bug

A similar issue (#3469) published on Dec, 2020 but now marked closed without a clear fix.
Problem: When using onUploadProgress in dev mode you will always have a 100 progress, I've seen this issue in multiple projects.

  • Note that in production build the progress will be calculated correctly. However, In dev we sometimes need to see the progress to adjust some UI, etc ..

To Reproduce

Calculate the upload percentage using onUploadProgress and display it in dev mode. You will notice always that the progressEvent's progress attribute is a constant 1, and loaded attribute have the final size of the file always, that's why the percentage will always be 100%.

Code snippet

{
    "loaded": 175254,
    "total": 175254,
    "progress": 1,
    "bytes": 175254,
    "event": {
        "isTrusted": true
    },
    "upload": true
}

Expected behavior

No response

Axios Version

1.5.0

Adapter Version

No response

Browser

All

Browser Version

No response

Node.js Version

20.11.0

OS

Windows 11, Android, IOS

Additional Library Versions

React 18.2.0
React native 0.71.8

Additional context/Screenshots

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant