Skip to content

fix: resolve RecursionError when activator is in same provider as its marker (#689)#691

Open
fadedDexofan wants to merge 1 commit intoreagento:developfrom
fadedDexofan:fix/689-recursion-provider-level-activation
Open

fix: resolve RecursionError when activator is in same provider as its marker (#689)#691
fadedDexofan wants to merge 1 commit intoreagento:developfrom
fadedDexofan:fix/689-recursion-provider-level-activation

Conversation

@fadedDexofan
Copy link
Contributor

@fadedDexofan fadedDexofan commented Mar 11, 2026

Fixes #689

  • Activators should not inherit when_active/when_override conditions from the provider's when, as they are the source of marker activation, not consumers, so we reset both to None in Activator.__get__() after Factory.__get__() applies the provider-level when.
  • Added regression test based on MRE from RecursionError when using provider level activation #689

@github-actions
Copy link

github-actions bot commented Mar 11, 2026

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/dishka/dependency_source
  activator.py
  src/dishka/entities
  marker.py 82, 162
Project Total  

This report was generated by python-coverage-comment-action

@fadedDexofan fadedDexofan force-pushed the fix/689-recursion-provider-level-activation branch 5 times, most recently from e170371 to bed8cfd Compare March 11, 2026 10:50
… marker (reagento#689)

Activators should not inherit when conditions from the provider,
as they are the source of marker activation, not consumers.
Reset when_active and when_override to None in Activator.__get__().
@fadedDexofan fadedDexofan force-pushed the fix/689-recursion-provider-level-activation branch from bed8cfd to 1d326bc Compare March 11, 2026 10:58
@fadedDexofan fadedDexofan marked this pull request as ready for review March 11, 2026 10:59
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

RecursionError when using provider level activation

1 participant