[BUGFIX] Fix stream mediator bootstrap method #39
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.
Release Notes - Version 4.6.1
🐛 Bug Fixes
Fixed
bootstrap_streamingsupport forCQRSContainerIssue: The
bootstrap_streamingmethod did not supportCQRSContainer(likeDependencyInjectorCQRSContainer), unlike other bootstrap methods (bootstrapfor requests, events, and sagas). This caused errors when trying to useDependencyInjectorCQRSContainerwith streaming mediators:Fix:
CQRSContainersupport tobootstrap_streamingmethod, following the same pattern as other bootstrap methodssetup_streaming_mediatorto accept bothDIContainerandCQRSContainertypesdi.ContainerandCQRSContainerinstances:di.Containeris provided, it wraps it inDIContainer()CQRSContaineris provided, it uses it directlyImpact: Users can now use
DependencyInjectorCQRSContainerand otherCQRSContainerimplementations withbootstrap_streaming, enabling dependency injection integration with streaming request handlers.✅ Testing
bootstrap_streamingwithDependencyInjectorCQRSContainer📝 Technical Details
Files Changed:
src/cqrs/requests/bootstrap.py: AddedCQRSContainersupport tobootstrap_streamingandsetup_streaming_mediatorNew Files:
tests/unit/test_bootstrap_streaming_dependency_injector.py: Comprehensive test suite for the new functionality🔄 Migration Guide
No migration required. This is a backward-compatible bug fix. Existing code using
di.Containerwill continue to work as before. Code usingCQRSContainerwithbootstrap_streamingwill now work correctly.