Skip to content

Register RegisterWaiter only through AddSignalWait (4.4.1) - #228

Merged
ognjenkatic merged 1 commit into
masterfrom
fix/signal-wait-opt-in-handler
Oct 8, 2026
Merged

ognjenkatic merged 1 commit into
masterfrom
fix/signal-wait-opt-in-handler

Conversation

@ognjenkatic

Copy link
Copy Markdown
Collaborator

Problem

Since 4.0.0, an app that calls AddConductorSharpPatterns() or AddCSharpLambdaTasks() but not AddSignalWait<T>() fails at startup when DI validation is on:

Unable to resolve service for type 'ConductorSharp.Patterns.Services.ISignalStore'
while attempting to activate 'ConductorSharp.Patterns.Tasks.RegisterWaiter'.

Both methods register MediatR handlers by scanning the whole Patterns assembly, and that scan also picks up RegisterWaiter. Its ISignalStore dependency is only registered by AddSignalWait.

Change

  • AddConductorSharpPatterns() and AddCSharpLambdaTasks() scan with a MediatR TypeEvaluator that excludes RegisterWaiter.
  • AddSignalWait<T>() is unchanged and still registers the handler, in either call order.
  • Version bumped to 4.4.1.
  • SKILL.md says the signal store is only needed with AddSignalWait.

Tests

New PatternsRegistrationTests build the provider with ValidateOnBuild:

  • Patterns + lambda tasks without SignalWait build cleanly, and RegisterWaiter is not registered. This test fails on master with the error above.
  • With AddSignalWait, called before or after the other two, the RegisterWaiter handler is registered and validation passes.

dotnet test: 73/73 passed.

3.x has no SignalWait, so no backport is needed.

🤖 Generated with Claude Code

AddConductorSharpPatterns() and AddCSharpLambdaTasks() scan the whole
Patterns assembly with MediatR, which also picked up the RegisterWaiter
handler. Its ISignalStore dependency is only registered by AddSignalWait,
so projects that don't use SignalWait failed DI validation at startup.

Both scans now exclude RegisterWaiter; AddSignalWait still registers it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ognjenkatic
ognjenkatic merged commit a2b7897 into master Oct 8, 2026
1 check passed
@ognjenkatic
ognjenkatic deleted the fix/signal-wait-opt-in-handler branch October 8, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant