Skip to content
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

LambdaClient::invokeAsync type incorrect #3004

Open
gauthierm opened this issue Sep 26, 2024 · 1 comment
Open

LambdaClient::invokeAsync type incorrect #3004

gauthierm opened this issue Sep 26, 2024 · 1 comment
Labels
documentation This is a problem with documentation. p3 This is a minor priority issue queued This issues is on the AWS team's backlog

Comments

@gauthierm
Copy link

Describe the issue

The LambdaClient::invokeAsync method has two type definitions, the second of which appears to be incorrect and overrides the first.

As I understand the SDK, invokeAsync should return a Promise, but the API docs say it returns a Result. This causes warnings when combined with PHPStan or other type checking tools.

Links

https://github.com/aws/aws-sdk-php/blob/master/src/Lambda/LambdaClient.php#L80-L81

@gauthierm gauthierm added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Sep 26, 2024
@gauthierm gauthierm changed the title (short issue description) LambdaClient::invokeAsync type incorrect Sep 26, 2024
@yenfryherrerafeliz
Copy link
Contributor

Hi @gauthierm, thanks for reporting this. The issue here is that the name of the operation from Lambda conflicts with our method naming convention. For every service operation we declare two methods, one is the synchronous version where we do not alter its name, for example Invoke, and the other is the asynchronous one that we suffix it with Async, for example InvokeAsync. And this last one is the one that should return a Promise. However, in this particular scenario Lambda has one operation called Invoke, for which we declare the two magic methods defined above, and another operation called 'InvokeAsync', for which we do the same. But, the synchronous method declaration for InvokeAsync will conflict with the asynchronous method of Invoke which will also be InvokeAsync.

I will add this to our backlog so I can discuss this further with my team.

Thanks!

@yenfryherrerafeliz yenfryherrerafeliz added p3 This is a minor priority issue queued This issues is on the AWS team's backlog and removed needs-triage This issue or PR still needs to be triaged. labels Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. p3 This is a minor priority issue queued This issues is on the AWS team's backlog
Projects
None yet
Development

No branches or pull requests

2 participants