framework icon indicating copy to clipboard operation
framework copied to clipboard

Fix consistency issue with inject aliases and dependency factories

Open rpanic opened this issue 2 months ago • 0 comments

The following happens currently: The ConsoleTracer is registered by default, generating the dependency under token "Tracer". The ConsoleTracer implements Closeable as an alias, therefore also registering under that token. Now OpenTelementryServer does the same, but there the Tracer isn't a closeable. Now when during shutdown, we resolve all dependencies under the token "Closeable", the previously created alias resolves to the new Tracer, which isn't closeable and therefore won't fulfill the interface, leading to errors.

Generally, this behavior is true for all aliases and dependency factories overwriting already existing dependencies in a container

rpanic avatar Nov 07 '25 20:11 rpanic