-
Notifications
You must be signed in to change notification settings - Fork 281
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 is not applied properly #940
Labels
Comments
sywhang
added a commit
to sywhang/fx
that referenced
this issue
Sep 22, 2022
There is a bug that only manifests when decorating objects in Fx where transient dependency types are not properly decorated. For example, if type A depends on type B, and type B depends on type C which has a decorator, it fails to recognize that. This only occurs when all constructors and the decorators for all these types are provided at the "root" level fx.App. This happens because fx injects a fake "root" Scope between the actual root Container (which is where constructors are provided to by default). Fixed by making fx stop create this fake root Scope and use the dig.Container directly. Fixes uber-go#940.
sywhang
added a commit
that referenced
this issue
Sep 22, 2022
There is a bug that only manifests when decorating objects in Fx where transient dependency types are not properly decorated. For example, if type A depends on type B, and type B depends on type C which has a decorator, it fails to recognize that. This only occurs when all constructors and the decorators for all these types are provided at the "root" level fx.App. This happens because fx injects a fake "root" Scope between the actual root Container (which is where constructors are provided to by default). Fixed by making fx stop create this fake root Scope and use the dig.Container directly. Fixes #940.
sywhang
added a commit
to sywhang/fx
that referenced
this issue
Oct 11, 2022
There is a bug that only manifests when decorating objects in Fx where transient dependency types are not properly decorated. For example, if type A depends on type B, and type B depends on type C which has a decorator, it fails to recognize that. This only occurs when all constructors and the decorators for all these types are provided at the "root" level fx.App. This happens because fx injects a fake "root" Scope between the actual root Container (which is where constructors are provided to by default). Fixed by making fx stop create this fake root Scope and use the dig.Container directly. Fixes uber-go#940.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Decorator is not applied properly when it is not required through a "direct" dependency.
To Reproduce
See #939.
Expected behavior
The test added in #939
Internal Ref: GO-1668
The text was updated successfully, but these errors were encountered: