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

Unduplicate a file-added hook #358

Closed ilessiivi closed 2 years ago

ilessiivi commented 2 years ago

Having the hook called in AsyncFlowFile may trigger a duplicate event whenever asyncAddFiles is called.

Other possibility to rectify this would be to rename file-added to file-inited or similar, and call it only in AsyncFlowFile's bootstrapping function.

drzraf commented 2 years ago

I'm really not sure about this one and can't take the time to reproduce the codepath. The ideal would have been to add a testcase, but I understand that would be a bit painful to test a duplicate event is NOT triggered I'll just merge to avoid any conflict in your subsequent PR, but let's keep an eye about this change.