-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[Messenger] Add a middleware that wraps all handlers in one Doctrine transaction. #26647
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e62a0c9
Add a middleware that wraps all handlers in one Doctrine transaction.
Nyholm 78f021d
Updated extension
Nyholm 50f2cb8
cs
Nyholm 11a3aab
Fixed tests
Nyholm 373a2d4
Handle a return value
Nyholm 4f54988
minor
Nyholm 1eb6f4d
Updates according to feedback
Nyholm 8b87f2b
Do not use an anonymous function
Nyholm a32e6b8
Added tests
Nyholm 0261a51
Adding configuration definition
Nyholm f362f50
cs
Nyholm a629620
cs
Nyholm 05ac7cf
Allow null
Nyholm 0e0ab07
Moved to DoctrineBridge
Nyholm af65748
Added extra check
Nyholm 701c665
Updating configuration
Nyholm b336d04
Fixed tests
Nyholm 7d84394
cs
Nyholm 09e5daf
cs and minors
Nyholm dcb07ca
Fixed tests
Nyholm 1603708
Fixed EOL
Nyholm 399f7c5
Added config key "middlewares"
Nyholm 5a6b8de
cs
Nyholm 68131f4
Use `addDefaultsIfNotSet()`
Nyholm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
Use
addDefaultsIfNotSet()
- Loading branch information
commit 68131f43bc806c93cca6617d78d6f311539cc5d6
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be configured via Framework, but via DoctrineBundle. We don't have any other Doctrine config here AFAIR.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabpot are you happy about the middleware being in the bridge, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding th 8000 is comment
The reason will be displayed to describe this comment to others. Learn more.
@fabpot actually, the cache also relies on Doctrine in
FrameworkBundle
. Note that this doesn't configure Doctrine either it justs allows enables the middleware. I'll submit a PR to remove it from here but I believe it might makes sense (follows the same pattern as cache configuration) to be here 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#26684 is in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think this makes sense as is. Moving it to doctrine bundle would mean configuring messenger middlewares in two different places, I can't think of a good final result.
We enable logging features for some components via framework config in the same way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to 8000 others. Learn more.
I agree with @chalasr , it's only a feature flag. It does no harm having this in the fwb whereas having to configure middlewares in 2 different config keys is really bad, DX wise. WDYT?