Completed shows wrong value after reupload using retryEnhancer
See original GitHub issueDescribe 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:
- Created 3 years ago
- Comments:10
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Well done! Now it works perfectly 🤌 Thank you a lot 🙏 😃
closing due to no info. Will reopen when more details are available