Skip to content

Maintenance: make Powertools UA middleware detection more robust #1761

Closed
@dreamorosi

Description

@dreamorosi

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

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

Labels

commonsThis item relates to the Commons UtilitycompletedThis item is complete and has been merged/shippedinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions