-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
History middleware doesn't work with MultiRegionClient #2574
Comments
Hi @joetannenbaum, thanks for opening this issue. I can confirm the error reported and we are currently investigating this. I will get back to you as soon as I get more updates regarding. Thanks! |
@yenfryherrerafeliz if there's any way I can help let me know, thanks so much! If you'd like to point me in the right direction I'd be happy to poke around. |
Hi @joetannenbaum, sorry for the delay responding to this. After a deeper look I found that, the reason why this issue happens is because, the middlewares added to the multi region client are invoked in a scope where the request is not built yet. To better explain this, lets revisit some components; HandlerList, that is a set of functions that shares data in between each other, and are invoked in order, and wheres the last function is the handler; The "handler" is a function responsible of returning a promise, and that when fulfilled it will return a object as result of type "Aws\ResultInterface". So, when we add a middleware, we are adding it to an one of the steps of a HandlerList instance. Now, lets check what is being executed when we call "$client->describeSecurityGroups", basically, describeSecurityGroups is considered a magic function and it is handled here, then, after the validations in there, we should end up in this line, and as we can see, it is calling the function ""$command->getHandlerList()->resolve()", which basically composes all the middlewares and the handler into a single callable function, which is called in the next line. So, what is the problem here?, the problem is that the middleware we have added to the handler list of the client, is being called before the handler here, and an exception is being thrown in that call, because there is not request built at that time; we can see in the handler logic that, there, is where the needed client "EC2Client" is created, and the command to be executed, which is gotten from that client, and then it returns $this->executeAsync($command), and there, is when and where the request starts to be built, based on the middlewares and handler that comes with the client created "EC2Client in this case". So, to summarize this problem:
Unfortunately at this time I do not have any workarounds at the top of my head, but I will bring this issue into the team tomorrow and I will provide updates accordingly. Thanks! |
@yenfryherrerafeliz wow thank you so much for this thorough explanation! I really appreciate you taking the time to explain the issue to me. Thank you for the continued updates. |
Hi @joetannenbaum, again thanks for raising this issue. At this time, we have decided that we will not implement this feature. Please, if you happen to need anything else that we may help with, feel free of opening a new issue. Thanks! |
This issue is now closed. Comments on closed issues are hard for our team to see. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
I'm trying to get the
history
middleware to work with theMultiRegionClient
, but it's missing a required argument for thestart
method. I've tried to track down where these arguments get passed in, but I haven't been able to locate it.Expected Behavior
I expect to be able to view the history of requests passed through the client.
Current Behavior
I encounter the following error:
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
SDK version used
3.246.1
Environment details (Version of PHP (
php -v
)? OS name and version, etc.)PHP 8.1.12, Mac, Laravel Valet
The text was updated successfully, but these errors were encountered: