filestack-js icon indicating copy to clipboard operation
filestack-js copied to clipboard

`onUploadDone` not behaving as expected

Open ktranada opened this issue 3 years ago • 2 comments

In the context of using custom storage, I require the resource key before persisting it to my own db. I am using onUploadDone with the expectation that it's called when the files have been uploaded and persisted to my storage choice.

onUploadStarted is an appropriate method to report that the files are InTransit.

The filesUploaded entries (the return type for onUploadDone) have varying statuses: InTransit or Stored, and only when it is Stored will the metadata contain a key.

I now understand that onUploadDone simply indicates that the files have been uploaded to the nearest FS edge server, but before it has reached the final destination. Although not ideal, I have implemented a metadata request method with retry logic.

What's the purpose of calling onUploadDone before the files are persisted to custom storage?

ktranada avatar Aug 07 '20 22:08 ktranada

Thank you for the metadata request idea, only way I was able to get around the key not being present.

nburnett-mw avatar May 09 '22 18:05 nburnett-mw

I'm looking into an issue that may be related to this. In the scenario where onUploadDone and the status is InTransit, does onUploadDone fire again with the status Stored?

KClough avatar May 16 '22 22:05 KClough