-
Notifications
You must be signed in to change notification settings - Fork 153
Bug: idempotent decorator in combination does not maintain class scope #2692
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
Comments
Update: Switching the order of the decorators did not change the behavior. |
Hi @HaaLeo - thanks for opening this issue. I'm looking into this and will report back here. |
I am able to reproduce the issue, and at first glance it does seem to be related to the issue you linked. After testing however, it doesn't appear to be related to the interaction with other decorators. If I remove the Tracer decorator altogether, the handler is still not able to access the logger property. Will continue to look into it. |
Hi @HaaLeo - you were right on the root cause of the issue and we were not preserving the scope of the decorated method. I have just put up a PR to address the bug. I have tested a build that includes the fix with the code snippet you shared and it seems to work. |
This issue is now closed. Please be mindful that future comments are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so. |
This is now released under v2.3.0 version! |
Expected Behavior
This is probably a follow up to #1481
When the
@idempotent
decorator is used with other powertools decorators such as the@tracer.captureLambdaHandler()
decorator the lambda function executes without an error with all the features of the decorators.Current Behavior
This is probably a follow up to #1481
When the
@idempotent
decorator is used with other powertools decorators such as the@tracer.captureLambdaHandler()
decorator the lambda function breaksCode snippet
Steps to Reproduce
Possible Solution
No response
Powertools for AWS Lambda (TypeScript) version
latest
AWS Lambda function runtime
20.x
Packaging format used
npm
Execution logs
The text was updated successfully, but these errors were encountered: