-
Notifications
You must be signed in to change notification settings - Fork 146
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
Bug: Decorator clears states too early #1085
Comments
Hi @idm-ryou, thanks for reporting this bug. Repository with sample app: https://github.com/saragerion/powertools-playground Log that does not show the added log attribute in cloudwatch: Logs outputted:
We will look into it. |
|
Bug description
Looks like decorator clears states too early on async/await codes.
https://awslabs.github.io/aws-lambda-powertools-typescript/latest/core/logger/#clearing-all-state
Expected Behavior
States are not cleared until handler execution is complete.
CloudWatch Logs
Current Behavior
State are cleared before the handler's execution is complete.
CloudWatch Logs
Possible Solution
await
handler and then clear states?https://github.com/awslabs/aws-lambda-powertools-typescript/blob/34d3a766acccce9c8292aeb3795d95d2aeea683a/packages/logger/src/Logger.ts#L299-L305
Steps to Reproduce
Environment
Related issues, RFCs
The text was updated successfully, but these errors were encountered: