Skip to content

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

@tracyboehrer tracyboehrer deleted the southworks/add/execution-limit-to-onerror branch December 23, 2025 18:41
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.

5 participants