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

fix: file upload rate displays NaN instead of an actual value #1777

Merged
merged 4 commits into from
Feb 15, 2024

Conversation

mdziekon
Copy link
Contributor

Description

This PR fixes incorrect upload (and download in GCode viewer, although barely noticeable) rate being displayed as NaN, instead of an actual value.

Problem is caused by an incorrectly used progressEvent argument of Axios'es onUploadProgress callback, which exposes its own event object wrapper, instead the raw browser event (as I think someone has assumed, or maybe was the case in the past). Now, with Axios 1.x being used, onUploadProgress callback exposes AxiosProgressEvent-typed interface (this PR also corrects typings usage, instead of the nasty implicit any).

AxiosProgressEvent "documentation" for reference (typings, their official documentation does not seem to describe the relevant interface).

Problem occurs on Firefox & Chromium based browsers.

Problem has been fixed for:

  • File explorer upload
  • "Upload & Print" topnav functionality
  • GCode viewer ("Current file" download snackbar)

Related Tickets & Documents

N/A

Mobile & Desktop Screenshots/Recordings

Note: upload artificially slowed down for testing purposes

Before

obraz

After

obraz

Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
@mdziekon mdziekon changed the title Fix/file upload rate nan fix: File upload rate displays NaN instead of an actual value Feb 14, 2024
@meteyou meteyou changed the title fix: File upload rate displays NaN instead of an actual value fix: file upload rate displays NaN instead of an actual value Feb 15, 2024
@meteyou meteyou merged commit 3b78c3b into mainsail-crew:develop Feb 15, 2024
8 of 9 checks passed
@meteyou
Copy link
Member

meteyou commented Feb 15, 2024

Thx for this fix! I didn't even notice this bug until just now. Looks like i overlooked an Axios update.

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

Successfully merging this pull request may close these issues.

2 participants