Send-only endpoints can incorrectly activate saga features when saga assemblies are scanned#7783
Merged
Merged
Conversation
…d-only endpoint so just checking saga metadata is not sufficient.
DavidBoike
approved these changes
May 28, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The feature prerequisite in https://github.com/Particular/NServiceBus/blob/release-10.0/src/NServiceBus.Core/Sagas/Sagas.cs#L25C9-L25C153 includes a check for send-only endpoints. As part of #7609, we moved the send-only check into the saga component itself, assuming that send-only endpoints would never contain sagas and therefore the feature prerequisite would prevent the feature from being enabled.
The problem is that if a send-only endpoint has any assemblies containing sagas available during assembly scanning, saga metadata can still be discovered. This causes the saga feature to become active, along with any features depending on it.
In the case of the SagaAudit feature, this resulted in a crash because ReceiveAddresses are not available in send-only endpoints:
https://github.com/Particular/NServiceBus.SagaAudit/blob/master/src/NServiceBus.SagaAudit/SagaAuditFeature.cs#L25
Needs to be backported to 10.1.x and 10.2.x
Symptoms
An error is raised at startup due to a missing service
ReceiveAddressesin the dependency injection container.Who's affected
Users are only affected when saga auditing is enabled on a send-only endpoint that also has saga code included (whether via assemblys canning or manually registered) which commonly through use of the NServiceBus.ServicePlatform.Connector plugin. This is a very uncommon configuration.
Root cause
A regression in feature registration code starting in version 10.1.0.