Skip to content
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

OnReceive is only run if all relevant Middleware Complete #146

Merged
merged 23 commits into from
Feb 19, 2018

Conversation

cleemullins
Copy link
Contributor

#130

This alters the behavior of the Bot, so that OnReceive is ONLY called if all relevant Middleware completes. If any middleware fails to call next, or throws, the the OnReceive handler will not be called. Based on consenus in #130, this is the desired behavior.

The only "edge" case is a Pipeline with no relevant Middleware. I've defined this as "Run OnReceive if there is no Middleware". This seems the correct behavior.

Relevant tests around this have been added testing the various conditions.

@cleemullins cleemullins added bug Indicates an unexpected problem or an unintended behavior. enhancement labels Feb 17, 2018
@cleemullins cleemullins added this to the 3/2 milestone Feb 17, 2018
@cleemullins cleemullins self-assigned this Feb 17, 2018
@cleemullins
Copy link
Contributor Author

Rebased against master to enable clean merge.


return results.Answers.Where(answer => answer.Score > _options.ScoreThreshold).ToArray();
}
return null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a trace would be useful here - QnA service returning a failure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnataylor

Agreed. That's part of a different PR (someone else did it) that's only showing up here because I rebased my PR against master to make merging cleaner.

/// <summary>
/// TO BOT FROM CHANNEL: Token validation parameters when connecting to a bot
/// </summary>
public static readonly TokenValidationParameters ToBotFromChannelTokenValidationParameters =
new TokenValidationParameters()
{
ValidateIssuer = true,
ValidIssuers = new[] { AuthenticationConstants.BotFrameworkTokenIssuer },
ValidIssuers = new[] { AuthenticationConstants.ToBotFromChannelTokenIssuer },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an unrelated fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnataylor Correct. That's showing up in this PR due to the rebasing against master. That was part of a PR (that's already accepted + merged) that Dan did earlier.

@cleemullins cleemullins merged commit d55477b into master Feb 19, 2018
@cleemullins cleemullins deleted the CLM/RunOnReceiveAtTheEnd branch February 19, 2018 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants