From fba1a19be103477c45e4377577b5ea606e3120ab Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Thu, 28 Nov 2024 19:41:01 +0100 Subject: [PATCH] Improve activity execution mapper's persistence logic Update the logic in DefaultActivityExecutionMapper to handle 'Inherit' persistence mode correctly. Instead of returning 'Inherit' directly, now it will default to the mode specified by defaultMode(). This change ensures consistent handling of persistence strategies. --- .../Services/DefaultActivityExecutionMapper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/Elsa.Workflows.Runtime/Services/DefaultActivityExecutionMapper.cs b/src/modules/Elsa.Workflows.Runtime/Services/DefaultActivityExecutionMapper.cs index a2ba663f9..0e1dd85de 100644 --- a/src/modules/Elsa.Workflows.Runtime/Services/DefaultActivityExecutionMapper.cs +++ b/src/modules/Elsa.Workflows.Runtime/Services/DefaultActivityExecutionMapper.cs @@ -200,7 +200,8 @@ public class DefaultActivityExecutionMapper : IActivityExecutionMapper return defaultMode(); var strategyContext = new LogPersistenceStrategyContext(cancellationToken); - return await strategy.GetPersistenceModeAsync(strategyContext); + var logMode = await strategy.GetPersistenceModeAsync(strategyContext); + return logMode == LogPersistenceMode.Inherit ? defaultMode() : logMode; } if (config.Expression == null)