This was a bug in Fine Uploader S3, currently fixed in the develop branch. The fix will go out tomorrow with Fine Uploader 4.2. Note that issue #1071, which you mentioned, will also be fixed as part of 4.2.
Now, when a key lookup function returns a qq.Promise
, and the fulfillment of the promise results in a failure()
, the associated upload will, in turn, be failed as well.
I would suggest you NOT use your key lookup function as an opportunity to validate your file. You really should be using the validate callback(s) for this. Why? Well, if you decide to "invalidate" a file in your key retrieval function and you have autoRetry enabled, Fine Uploader S3 will attempt to retry until all auto retries are failed. Hardly what you want when invalidating a file. I don't expect to change this behavior as the expectation is that a failed key retrieval is something we would want to re-attempt. Also, if you invalidate a file via your key retrieval function, the status of the file will be qq.status.UPLOAD_FAILED
instead of what you might want (qq.status.REJECTED
). Why? Fine Uploader S3 doesn't know that you invalidate the file, just that key retrieval failed.