Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Chained promissory callbacks do not pass the resolve result back to Fine Uploader #5

Closed
rnicholus opened this issue Sep 27, 2017 · 0 comments · Fixed by #6
Closed
Labels
Milestone

Comments

@rnicholus
Copy link
Member

rnicholus commented Sep 27, 2017

This is currently only an issue with:

  • onCredentialsExpired (S3)
  • onPasteReceived

...but it is also an issue with FineUploader/fine-uploader#1917 (currently Fine Uploader v5.16.0-alpha.2), which allows a Promise to be returned from onUpload and onUploadChunk, the latter accepting an object to influence the resulting chunk upload request.

The solution here seems to be to capture the resolved value of each Promise and ultimately pass through to the underlying Promise connected to the wrapped instance of Fine Uploader (via the options object). Perhaps I should adjust the code to accumulate properties from all callbacks in the chain that resolve with objects.

And if none of the callbacks resolve with objects, then resolve the underlying Promise with the last non-null/undefined resolved value (onPasteReceived). But it may be more sane to simply ignore non-object resolved values and update Fine Uploader in v6 to expect an object from the onPasteReceived callback instead of a string.

@rnicholus rnicholus added the bug label Sep 27, 2017
@rnicholus rnicholus added this to the 1.0.1 milestone Sep 27, 2017
rnicholus added a commit that referenced this issue Sep 28, 2017
fixes #5

Also:
feat(callback-names): onUpload and onUploadChunk now accept promises
re: FineUploader/fine-uploader#1917
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant