From 99370502dcb5ae2e3336cf2fe025ae8150802110 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Fri, 13 Jun 2025 19:43:46 +0200 Subject: [PATCH 1/5] Refactor query composition to ensure proper ordering before pagination in `WorkflowExecutionLogStore`. --- .../Modules/Runtime/WorkflowExecutionLogStore.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Runtime/WorkflowExecutionLogStore.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Runtime/WorkflowExecutionLogStore.cs index 2569f479e..94ca16dc5 100644 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Runtime/WorkflowExecutionLogStore.cs +++ b/src/modules/Elsa.EntityFrameworkCore/Modules/Runtime/WorkflowExecutionLogStore.cs @@ -52,8 +52,8 @@ public class EFCoreWorkflowExecutionLogStore(EntityStore public async Task> FindManyAsync(WorkflowExecutionLogRecordFilter filter, PageArgs pageArgs, CancellationToken cancellationToken = default) { - var count = await store.QueryAsync(queryable => Filter(queryable, filter).OrderBy(x => x.Timestamp), cancellationToken).LongCount(); - var results = await store.QueryAsync(queryable => Filter(queryable, filter).Paginate(pageArgs), OnLoadAsync, cancellationToken).ToList(); + var count = await store.QueryAsync(queryable => Filter(queryable, filter), cancellationToken).LongCount(); + var results = await store.QueryAsync(queryable => Filter(queryable, filter).OrderBy(x => x.Timestamp).Paginate(pageArgs), OnLoadAsync, cancellationToken).ToList(); return new(results, count); } From b8a04b11d12628d9de94abd6bb0c99a5fb877cea Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Thu, 3 Jul 2025 22:21:40 +0200 Subject: [PATCH 2/5] Register `FlowScope` class map in MongoDB feature to handle serialization and ignore extra elements. (#6766) --- src/modules/Elsa.MongoDb/Features/MongoDbFeature.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/Elsa.MongoDb/Features/MongoDbFeature.cs b/src/modules/Elsa.MongoDb/Features/MongoDbFeature.cs index 09c7afba3..4fa93b3fd 100644 --- a/src/modules/Elsa.MongoDb/Features/MongoDbFeature.cs +++ b/src/modules/Elsa.MongoDb/Features/MongoDbFeature.cs @@ -78,6 +78,12 @@ public class MongoDbFeature(IModule module) : FeatureBase(module) map.SetIgnoreExtraElements(true); // Needed for missing ID property map.MapProperty(x => x.Key); // Needed for non-setter property }); + + BsonClassMap.TryRegisterClassMap(map => + { + map.AutoMap(); + map.SetIgnoreExtraElements(true); + }); } private static void TryRegisterSerializerOrSkipWhenExist(Type type, IBsonSerializer serializer) From ea9c94de7e9d19333c2d2699f7e7428a57f22a04 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Thu, 3 Jul 2025 22:24:37 +0200 Subject: [PATCH 3/5] Add missing import for `Flowchart.Models` in `MongoDbFeature` --- src/modules/Elsa.MongoDb/Features/MongoDbFeature.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/Elsa.MongoDb/Features/MongoDbFeature.cs b/src/modules/Elsa.MongoDb/Features/MongoDbFeature.cs index 4fa93b3fd..a6b815b70 100644 --- a/src/modules/Elsa.MongoDb/Features/MongoDbFeature.cs +++ b/src/modules/Elsa.MongoDb/Features/MongoDbFeature.cs @@ -7,6 +7,7 @@ using Elsa.MongoDb.Contracts; using Elsa.MongoDb.NamingStrategies; using Elsa.MongoDb.Options; using Elsa.MongoDb.Serializers; +using Elsa.Workflows.Activities.Flowchart.Models; using Elsa.Workflows.Memory; using Elsa.Workflows.Runtime.Entities; using Microsoft.Extensions.DependencyInjection; From 9a82b8b66b79ea35eec7c5c0ab9e0cfb43923e5f Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Fri, 4 Jul 2025 09:34:00 +0200 Subject: [PATCH 4/5] Add backward compatibility for `WorkflowInstance.Name` mapping in `WorkflowStateMapper` (#6767) * Add backward compatibility for `WorkflowInstance.Name` mapping in `WorkflowStateMapper` - Introduced constant `WorkflowInstanceNameKey` to handle legacy workflow instance name properties. - Updated `MapWorkflowStateToWorkflowInstance` method to set `Name` property for older instances. * Remove unused `Elsa.Workflows.Activities` import from `WorkflowStateMapper` * Update src/modules/Elsa.Workflows.Management/Mappers/WorkflowStateMapper.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Mappers/WorkflowStateMapper.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/Elsa.Workflows.Management/Mappers/WorkflowStateMapper.cs b/src/modules/Elsa.Workflows.Management/Mappers/WorkflowStateMapper.cs index cea8e3a2a..deccb8170 100644 --- a/src/modules/Elsa.Workflows.Management/Mappers/WorkflowStateMapper.cs +++ b/src/modules/Elsa.Workflows.Management/Mappers/WorkflowStateMapper.cs @@ -1,3 +1,4 @@ +using Elsa.Extensions; using Elsa.Workflows.Management.Entities; using Elsa.Workflows.State; @@ -8,6 +9,12 @@ namespace Elsa.Workflows.Management.Mappers; /// public class WorkflowStateMapper { + /// + /// [Obsolete] The property key name used to store the workflow instance name. + /// + [Obsolete("This constant is obsolete and retained only for backward compatibility. Avoid using it in new code.")] + private const string WorkflowInstanceNameKey = "WorkflowInstanceName"; + /// /// Maps a workflow state to a workflow instance. /// @@ -43,6 +50,10 @@ public class WorkflowStateMapper target.UpdatedAt = source.UpdatedAt; target.FinishedAt = source.FinishedAt; target.WorkflowState = source; + + // Keep for backward compatibility with workflow instances created before the introduction of the Name property. + if (source.Properties.TryGetValue(WorkflowInstanceNameKey, out var name)) + target.Name = name; } /// From 45bfcc9eeb76889b3a589445446a161f38d4705b Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Fri, 4 Jul 2025 09:58:09 +0200 Subject: [PATCH 5/5] Update release workflow for 3.4.2 patch tracking Adjusted branch filtering logic in `packages.yml` to track `3.4.2` patch release. --- .github/workflows/packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 28c63d94d..fb98689ee 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -46,7 +46,7 @@ jobs: run: | if [[ "${{ github.ref }}" == refs/tags/* && "${{ github.event_name }}" == "release" && ("${{ github.event.action }}" == "published" || "${{ github.event.action }}" == "prereleased")]]; then git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* - git branch --remote --contains | grep origin/patch/3.4.1 + git branch --remote --contains | grep origin/patch/3.4.2 else git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* git branch --remote --contains | grep origin/${BRANCH_NAME}