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 decorator not being applied to transient dependencies #941

Merged
merged 2 commits into from
Sep 22, 2022

Commits on Sep 22, 2022

  1. Fix decorator not being applied to transient dependencies

    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 committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    0dc0315 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5f425f6 View commit details
    Browse the repository at this point in the history