Skip to content

Property Pages can now wire up services #3357

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 18 commits into from
Jun 23, 2024
Merged

Property Pages can now wire up services #3357

merged 18 commits into from
Jun 23, 2024

Conversation

amolenaar
Copy link
Member

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is the current behavior?

We have a global @transactional decorator. This decorator works as long as the system is fully aware of the active session. This of course causes trouble if a non-active session starts to do something in the background.

Issue Number: Fixes #3351.

What is the new behavior?

Instead, all places where transactions are started should have access to the services, mainly event_manager. This ensures that the transaction is run in the right context.

Does this PR introduce a breaking change?

  • Yes
  • No

The @transactional decorator has been removed.

Other information

I wanted to fix this for a long time. #3348 was the trigger to rethink the problem again. In the end it seemed pretty simple: the component_registry should have a method to (partially) apply services to any function or class.

@github-actions github-actions bot added the python Pull requests that update Python code label Jun 19, 2024
@amolenaar amolenaar force-pushed the property-pages-di branch from 88e1871 to 6d0f002 Compare June 19, 2024 10:05
@github-actions github-actions bot added translation Everything regarding translation, localization, and internationalization documentation labels Jun 19, 2024
Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @amolenaar, these changes look great, nice improvement!

@danyeaw danyeaw added chore Maintenance related PR and removed python Pull requests that update Python code translation Everything regarding translation, localization, and internationalization documentation labels Jun 23, 2024
@danyeaw danyeaw merged commit 212f836 into main Jun 23, 2024
@danyeaw danyeaw deleted the property-pages-di branch June 23, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance related PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dependency injection for property pages
2 participants