filestack-js
filestack-js copied to clipboard
`onUploadDone` not behaving as expected
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?
Thank you for the metadata request idea, only way I was able to get around the key not being present.
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
?