-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating multiple signed URL promises fails with duplicate middleware error #1857
Comments
Can confirm I am experiencing similar behavior when implemented in a REST API. |
As a temporary work around until there is a patch, I switched to: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#getSignedUrlPromise-property let promise = s3.getSignedUrlPromise('getObject', params) which has been working so far without incident. |
What package and version are you using? In |
@olokobayusuf I'm using the latest version of |
Thanks! I realized you probably weren't using the v3 SDK any longer. @AllanZhengYP I see you've moved this to |
Thanks @AllanZhengYP!! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
I'm using the
@aws-sdk/client-s3
and@aws-sdk/s3-request-presigner
packages to sign S3 object URL's in my GraphQL API. I've run into an issue where if there are multiple promises requesting a URL in one node tick, the following error occurs:Doing some quick digging through the
s3-request-presigner
code, it looks like the implementation uses a naive stack placement without regard for multiple concurrent requests being a possibility:aws-sdk-js-v3/packages/s3-request-presigner/src/getSignedUrl.ts
Lines 43 to 56 in 314d3b3
As such, the following code will fail:
Whereas this won't:
I was able to partially workaround this by refactoring my code, but now I happen to be exposing URL pre-signing through a resolver managed by GraphQL. As such I can't refactor the code to avoid this bug; it can only be fixed upstream. I remember that a while ago, pre-signed URL's didn't need to make any actual request; it was entirely generated locally. Can this behaviour be imitated? And how quickly can this bug be fixed? It's a (very serious) blocker.
SDK version number
Is the issue in the browser/Node.js/ReactNative?
Node JS
Details of the browser/Node.js/ReactNative version
Node JS v12.4.0
To Reproduce (observed behavior)
See above.
Expected behavior
No middleware stack error should occur.
Screenshots
From GraphQL:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: