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
sts.assumeRole().promise() returns undefined when succeds #2015
Comments
Hi @mim-Armand, I cannot reproduce this issue. Are you using any un-default promise library? |
Not using any library for that, I simply add ( the undocumented ) So |
Yes. I used the code snippet you shared as above and it works as expected. I was using a test user with all STS permissions. Can you show me what's the printout you get from the code snippet above? |
the printout was |
I have run into this same issue, and the discussion above is about as clear as mud. Is there an actual code example demonstrating how to work around this issue? I can't just use the v3 SDK because it won't be out for at least another six months... |
@maxharris9 The snippet in the original post actually works, just make sure to consume the promise only in one place otherwise it may cause a racing condition. There is a difference ( or maybe a bug ) in the implementation of the Promise in this SDK ( at least the version I was using back then ) and the standard implementation/specifications of the Promise APIs: I will re-open this issue hoping someone will explain it better and/or clearer than me to help you out, or put it on the roadmap if it's a bug or something that can help more people, but otherwise please feel free to close it |
Dear Amazon: |
@maxharris9 Can you make sure the 'complete' event is triggered in your request? like here: request.
on('complete', function(resp) {
console.log('request completes: ', resp.data);
});
await request.promise(); More information about event listeners: https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/using-a-response-event-handler.html |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
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. |
Using callback works in both happy-path and failure:
using
.promise()
however returnsundefined
when the request succeeds, it behaves as expected when the request fails:Thanks
The text was updated successfully, but these errors were encountered: