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

Respond with 500 in case of Incidents #5004

Merged
merged 2 commits into from
Feb 28, 2024
Merged

Respond with 500 in case of Incidents #5004

merged 2 commits into from
Feb 28, 2024

Conversation

sfmskywalker
Copy link
Member

Fixes #5003

The handling for workflow faults in the Workflow Middleware has been altered. Previously, the code was checking if the workflow state status was designated as 'Faulted'. Now it checks if there are any incidents or problems in the workflow state, which provides a more comprehensive fault check.
Added checks in the 'Delete' and 'PagedDelete' methods in the 'Store.cs' file to prevent the deletion of all records if the conditions are empty. This will protect the system from unintentional data loss by stopping the execution of these methods when they have no parameters.
@sfmskywalker sfmskywalker added bug Something isn't working elsa 3 This issue is specific to Elsa 3 labels Feb 26, 2024
@@ -245,6 +245,11 @@ public async Task<long> DeleteAsync(Action<ParameterizedQuery> filter, Cancellat
{
var query = _dbConnectionProvider.CreateQuery().Delete(TableName);
filter(query);

// If there are no conditions, we don't want to delete all records.
if (!query.Parameters.ParameterNames.Any())
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to support a delete all statement?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably eventually, yes, but I couldn't think of a decent solution on the spot, and I don't think we have a current use case for it that warrants additional work on the Dapper provider.

@sfmskywalker sfmskywalker merged commit ce27c9a into main Feb 28, 2024
2 checks passed
@sfmskywalker sfmskywalker deleted the issue/5003 branch February 28, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working elsa 3 This issue is specific to Elsa 3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTTP Endpoint Activity Incorrectly Responds with 200 OK on Incidents with "Continue with Incidents" Strategy
2 participants