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

fix(kernel): incorrectly scoped FQN resolutions #4204

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

RomainMuller
Copy link
Contributor

@RomainMuller RomainMuller commented Aug 2, 2023

The registration was done on the object's prototype, and the value from the constructor was always used, even if that was inherited, such that if a parent type had already been resolved previously, all child types would use the parent's FQN instead of their own.

Addressed this by instead storing the associations in an external WeakMap, and added a test case to validate correct behavior.

Fixes aws/aws-cdk#26604
Fixes #4202
Fixes #4203


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The registration was done on the object's prototype, and tthe value from
the constructor was always used, even if that was inherited, such that
if a parent type ahd already been resolved previously, all child types
would use the parent's FQN instead of their own.

Addressed this by instead storing the associations in an external
WeakMap, and added a test case to validate correct behavior.

Fixes aws/aws-cdk#26604
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Aug 2, 2023
@psychon
Copy link

psychon commented Aug 2, 2023

Since this only mentions the issue over at aws-cdk: I can't check this personally, but from the description it very much sounds like this would also fix #4202 and #4203

@RomainMuller
Copy link
Contributor Author

RomainMuller commented Aug 2, 2023

@psychon you're absolutely correct! Thanks for pointing these out!

@RomainMuller RomainMuller merged commit ed667c7 into main Aug 2, 2023
@RomainMuller RomainMuller deleted the rmuller/fix-fqn-resolution branch August 2, 2023 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
2 participants