Skip to content

BUGFIX: Prevent premature connection to database in WorkspaceMetadataAndRoleRepository #5594

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

Open
wants to merge 1 commit into
base: 9.0
Choose a base branch
from

Conversation

mhsdesign
Copy link
Member

Im currently experimenting with a faster node controller which takes the resolved node address (which is cached via flows routing cache) and then looks up the cache entry for the document and outputs that. (For the component engine ^^)

Now because we nowadays prever eager injections via constructor or typed property a database connection is created already only because the NodeController injects the ContentRepositoryAuthorizationService eagerly even it is not asked a question.

This pr ensures the repository fetches the connection only on use. Alternatively we can move the lazy injection to the node controller by using:

/**
 * @var ContentRepositoryAuthorizationService
 * @Flow\Inject
 */
protected $contentRepositoryAuthorizationService;

Upgrade instructions

Review instructions

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

@kdambekalns
Copy link
Member

I think it is quite fair to assume the repository will need a database connection. I'd rather inject the repository itself lazily wherever I am not sure I'll need it.

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.

2 participants