Description
Summary
AWS SDK can have only one middleware with the same identifier in the same middleware stack. In order to avoid hitting this error we currently try to compare the ids of the middlewares present in a client middleware stack before attempting to attach our own.
The current method does an exact string comparison using the id of the middleware, as well as other metadata, which can be problematic in case the middleware stack order changes or the information returned by the client.middlewareStack.identify()
function changes.
We should move to a more loose comparison to instead check for the middleware id only.
Why is this needed?
To decrease the chance of false positives, and ultimately be able to attach the middleware correctly.
Which area does this relate to?
Other
Solution
No response
Acknowledgment
- This request meets Powertools for AWS Lambda (TypeScript) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and .NET
Future readers
Please react with 👍 and your use case to help us understand customer demand.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status