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

fix: Add counter to onError trigger to break possible loops #4648

Open
wants to merge 5 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 execute method.
  • Updated internalRun method in DialogHelper 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 conditional.tests to cover the new functionality.

Testing

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

@ceciliaavila ceciliaavila added the no parity This issue applies only to this platform label Apr 18, 2024
@ceciliaavila ceciliaavila requested a review from a team as a code owner April 18, 2024 14:13
@coveralls
Copy link

coveralls commented Apr 18, 2024

Pull Request Test Coverage Report for Build 8739502331

Details

  • 19 of 19 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 84.444%

Totals Coverage Status
Change from base Build 8706846204: 0.01%
Covered Lines: 20444
Relevant Lines: 22919

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no parity This issue applies only to this platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants