elsa-workflows / elsa-workflows/elsa-extensions

EFCoreActivityExecutionStore.SaveManyAsync missed handlers of IEntitySavingHandler

Open
#53 0 comments 1 reaction 1 assignee Assigned to @Copilot View on GitHub
triaged
Dominant language
C#
Stars
49
Forks
48
Avg merge
21h 35m
Merged PRs (30d)
20

Description

## Description
It seems that when saving activity execution from `DefaultCommitStateHandler` -> `activityExecutionLogRecordSink.PersistExecutionLogsAsync`, it uses `BulkUpsertExtensions.BulkUpsertAsync` to generate sql to insert records, which didn't go through DbContext, leading to all registers for `IEntitySavingHandler` were skipped.

I temporary did override the implementation for `StoreActivityExecutionLogSink` to use `activityExecutionStore.SaveAsync` instead of `SaveManyAsync` and it worked as expected

## Steps to Reproduce

1. Create a new handler of `IEntitySavingHandler` e.g: CustomEntitySavingHandler

2. Register to services

3. Run a workflow

## Expected Behavior
Expected that `CustomEntitySavingHandler` will be called on each `ActivityExecutionRecord`

## Actual Behavior
CustomEntitySavingHandler is called for others (like `StoredBookmark`) but not `ActivityExecutionRecord`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.