progress briefly jumps to 0 after upload is finished #813
Closed
Description
I'm having an issue:
- ostrio:files@2.0.1
- Meteor 2.3.4
- Ubuntu 20.04, Chromium 92.0.4515.159
- Client
The following code (I'm using Svelte):
function handleFilePickerChange(e) {
const upload = AttachmentsCollection.insert(
{
file: e.target.files[0],
chunkSize: 'dynamic',
},
false
);
upload.on('start', function () {
console.log('Started upload');
});
upload.on('end', function (error, fileObj) {
if (error) {
console.log(`Error during upload: ${error}`);
} else {
console.log(`File "${fileObj.name}" successfully uploaded`);
}
});
Tracker.autorun(() => {
console.log(upload.progress.get());
});
upload.start();
e.target.value = '';
}
Produces the following logs:
As you can see the progress briefly logs 0 before 100. It's probably not noticeable when rendering a progress bar (unless you're using transitions). I hope this is enough info to reproduce the problem. I'm a first time Meteor user (started this week) and I've used Meteor-Files for approximately 30 minutes.