Skip to content

[DependencyInjection] Fix circular in DI with lazy + byContruct loop #39129

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

Merged
merged 1 commit into from
Nov 27, 2020

Conversation

jderusse
Copy link
Member

@jderusse jderusse commented Nov 20, 2020

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #39120
License MIT
Doc PR -

This fix another issue lazy service.
It partially revert #38980 and #39021

Initially, we trusted lazy services to be lazy and not beeing called while building the services graph
=> bug #38970 when lazy deps is injected in a factory, it may be consumed directly to build the object before the graph is fully built
Fixed by #38980 => lazy service are considered as "normal service"
=> bug #39015 some loop are not resolvable with "normal service", but it shouldn't be an issue when servie proxifyied
Fixed by #39021 => lazy service are considered as "normal service" except when proxyfied
=> bug #39120 some loop are not resolvable with "normal service", but it shouldn't be an issue because the lazy service is injected in the constructor and user

Fixed by this PR => that revert to the initial state. lazy service are trusted.
But now, The IterratorArgument injected in a factory (single exception) is not more considered as lazy

@carsonbot carsonbot added this to the 4.4 milestone Nov 20, 2020
@carsonbot carsonbot changed the title Fix circular in DI with lazy + byContruct loop [DependencyInjection] Fix circular in DI with lazy + byContruct loop Nov 20, 2020
@eerison

This comment has been minimized.

@eerison
Copy link

eerison commented Nov 21, 2020

@jderusse Why are you putting branch 4.4 as target? it's happen when I'm trying to use symfony 5.2 😕

@derrabus
Copy link
Member

@eerison We always fix bugs on the lowest branch that they occur on.

@nicolas-grekas
Copy link
Member

Thank you @jderusse.

@nicolas-grekas nicolas-grekas merged commit 7d7fa3e into symfony:4.4 Nov 27, 2020
This was referenced Nov 29, 2020
@jderusse jderusse deleted the di-fix-circular branch December 9, 2020 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants