The UseWhen method doesn't wire up the next delegate properly.
Expected
In the example pipeline below, the C middleware should be the next delegate passed to the B middleware. Therefore, C should be invoked only if next is invoked in the B.
new BotBuilder()
.Use<A>()
.UseWhen(predicate, branch =>
branch.Use<B>()
)
.Use<C>()
Actual
But the C middleware is always invoked regardless of calling the next delegate in B.
The
UseWhen
method doesn't wire up thenext
delegate properly.Expected
In the example pipeline below, the
C
middleware should be thenext
delegate passed to theB
middleware. Therefore,C
should be invoked only ifnext
is invoked in theB
.Actual
But the
C
middleware is always invoked regardless of calling thenext
delegate inB
.