flowjs / flow.js

A JavaScript library providing multiple simultaneous, stable, fault-tolerant and resumable/restartable file uploads via the HTML5 File API.
Other
2.96k stars 346 forks source link

Complete running before fileSuccess #381

Open stephanieraymos opened 1 year ago

stephanieraymos commented 1 year ago

this.flow.on('complete', () => { ... }) is running before this.flow.on('fileSuccess', async (flowFile, message, flowChunk) => { ... })

Inside fileSuccess I run a function that completes the multipart upload, and set the url to the value returned from that function. That url is then used inside the complete method. But since the complete method is running BEFORE fileSuccess, it doesn't have that url yet.

Isn't complete supposed to run only when uploading is complete?

Side note: This same approach works fine when using directories, this error/bug only occurs when uploading files.