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

Add counter to onError trigger to break possible loops #6776

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ceciliaavila
Copy link
Collaborator

#minor

Description

This PR adds a counter in the loop that executes the onError trigger to detect and break possible infinite loops when there's an error inside the onError handler.
It also includes a new property to the onError, to make the limit of executions configurable for the users (default value: 10).

Specific Changes

  • Added ExecutionLimit property to the onError trigger and read it in the override of the ExecuteAsync method.
  • Updated InternalRunAsync in DialogExtensions to evaluate the execution limit property and break the loop in case of detecting one.
  • Added ExecutionLimit property to TurnPath to be able to store the value in memory.
  • Updated Microsoft.OnError.schema and Microsoft.OnError.uischema to include the new property.
  • Added 2 unit tests in ConditionalTests to cover the new functionality.

Testing

These images show the scenarios we tested with the new implementation.
image

@ceciliaavila ceciliaavila added the Automation: No parity PR does not need to be applied to other languages. label Apr 18, 2024
@ceciliaavila ceciliaavila requested a review from a team as a code owner April 18, 2024 14:07
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 387980

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 6 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.005%) to 78.177%

Files with Coverage Reduction New Missed Lines %
/libraries/Microsoft.Bot.Builder.Dialogs/Memory/TurnPath.cs 1 0.0%
/libraries/Microsoft.Bot.Streaming/Payloads/StreamManager.cs 1 90.0%
/libraries/Microsoft.Bot.Builder.Dialogs/DialogExtensions.cs 4 95.29%
Totals Coverage Status
Change from base Build 387708: 0.005%
Covered Lines: 26198
Relevant Lines: 33511

💛 - Coveralls

@BruceHaley
Copy link
Contributor

✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Dialogs.dll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Automation: No parity PR does not need to be applied to other languages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants