question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Completed shows wrong value after reupload using retryEnhancer

See original GitHub issue

Describe the bug Using tus-uploader with retryEnhancer it’s correctly continue upload a chunks after eg. refreshing page. item.completed property from useItemProgressListener event start counting from the beginning, also item.loaded property looks the same.

Expected behavior Uploader should provide a correct values including previously successfully uploaded chunks

Versions

    "@rpldy/retry": "^0.10.0",
    "@rpldy/retry-hooks": "^0.10.0",
    "@rpldy/shared": "^0.10.0",
    "@rpldy/tus-uploady": "^0.9.0",
    "@rpldy/upload-button": "^0.9.0",
    "@rpldy/upload-drop-zone": "^0.9.0",
    "@rpldy/uploader": "^0.9.0",
    "@rpldy/uploady": "^0.9.0",

Code UploadyContextComponent.js

//other import above
import TusUploady  from "@rpldy/tus-uploady";
import { retryEnhancer } from "@rpldy/retry";
//other imports below

//some other code inside component
<TusUploady
    destination={{
      url: `${process.env.REACT_APP_API_URL}/upload-resumable`,
      headers: { Authorization: `Bearer ${token}` },
    }}
    enhancer={retryEnhancer}
    concurrent={evalBool(process.env.REACT_APP_UPLOAD_CONCURRENT)}
    maxConcurrent={evalInt(process.env.REACT_APP_UPLOAD_MAX_CONCURRENT)}
    chunkSize={evalInt(process.env.REACT_APP_UPLOAD_CHUNK_SIZE)}
    autoUpload={evalBool(process.env.REACT_APP_UPLOAD_AUTO)}
    sendDataOnCreate={evalBool(process.env.REACT_APP_UPLOAD_SEND_DATA_ON_CREATE)}
    withCredentials={evalBool(process.env.REACT_APP_UPLOAD_WITH_CREDENTIALS)}
  >
//som other code

UploadProgress.js

import { FILE_STATES } from "@rpldy/shared";

import PublishIcon from '@material-ui/icons/Publish';
import HourglassEmptyIcon from '@material-ui/icons/HourglassEmpty';
import DoneIcon from '@material-ui/icons/Done';
import PriorityHighIcon from '@material-ui/icons/PriorityHigh';
import BlockIcon from '@material-ui/icons/Block';
import HelpOutlineIcon from '@material-ui/icons/HelpOutline';

import CircularProgress from "components/CircularProgress";

function UploaderProgress({item}) {

  const { completed, state } = item;

  return(<CircularProgress value={completed} title={state}>
    {state === FILE_STATES.FINISHED && <DoneIcon />}
    {state === FILE_STATES.UPLOADING && <PublishIcon />}
    {state === FILE_STATES.PENDING && <HourglassEmptyIcon />}
    {state === FILE_STATES.ADDED && <HourglassEmptyIcon />}
    {state === FILE_STATES.ERROR && <PriorityHighIcon />}
    {state !== FILE_STATES.ERROR && (state === FILE_STATES.CANCELLED || state === FILE_STATES.ABORTED) && <BlockIcon />}
    {!Object.values(FILE_STATES).some(fileState => fileState === state) && <HelpOutlineIcon />}
  </CircularProgress>)
}

export default UploaderProgress;

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
aleksander-luriecommented, Mar 8, 2021

Well done! Now it works perfectly 🤌 Thank you a lot 🙏 😃

0reactions
yoavnirancommented, Apr 16, 2021

closing due to no info. Will reopen when more details are available

Read more comments on GitHub >

github_iconTop Results From Across the Web

The 100 Greatest TV Shows of All Time - Rolling Stone
The definitive ranking of the 100 best shows in TV history, as determined by a poll of actors, producers, showrunners, critics, ...
Read more >
Best TV Shows 2022: 'Reservation Dogs,' 'Abbott Elementary ...
Best TV Shows of 2022. In a year dominated by the familiar, series like “Reservation Dogs,” “The Rehearsal,” “Bad Sisters” and others showed ......
Read more >
This is Going to Hurt: What medical shows get right and wrong
A new BBC/AMC series depicts the exhausting life of a British doctor with dark comedy. And it might be the most realistic hospital...
Read more >
Breaking Bad - Wikipedia
Breaking Bad is an American crime drama television series created and produced by Vince Gilligan. Set and filmed in Albuquerque, New Mexico, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found