From b05eb3096b0bf616c241f5a7d78d5cb97e7b7087 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Sun, 21 Jun 2026 23:18:33 +0200 Subject: [PATCH 1/3] Fix flaky publish event payload test Make the PublishEvent payload assertion case-insensitive so it tolerates JsonPayloadSerializer camelCase output after a JSON round trip. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Primitives/Event/PublishEventTests.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/component/Elsa.Workflows.ComponentTests/Scenarios/Activities/Primitives/Event/PublishEventTests.cs b/test/component/Elsa.Workflows.ComponentTests/Scenarios/Activities/Primitives/Event/PublishEventTests.cs index b1390b510..db0e44fe6 100644 --- a/test/component/Elsa.Workflows.ComponentTests/Scenarios/Activities/Primitives/Event/PublishEventTests.cs +++ b/test/component/Elsa.Workflows.ComponentTests/Scenarios/Activities/Primitives/Event/PublishEventTests.cs @@ -74,10 +74,25 @@ public class PublishEventTests : AppComponentTest // Verify the payload structure and content using var payloadDocument = JsonDocument.Parse(JsonSerializer.Serialize(receivedPayload)); - Assert.True(payloadDocument.RootElement.TryGetProperty("Status", out var status), "Received payload should contain a Status property"); + Assert.True(TryGetProperty(payloadDocument.RootElement, "Status", out var status), "Received payload should contain a Status property"); Assert.Equal("Shipped", status.GetString()); } + private static bool TryGetProperty(JsonElement element, string propertyName, out JsonElement property) + { + foreach (var candidate in element.EnumerateObject()) + { + if (candidate.Name.Equals(propertyName, StringComparison.OrdinalIgnoreCase)) + { + property = candidate.Value; + return true; + } + } + + property = default; + return false; + } + private async Task GetSingleWorkflowInstanceAsync(string definitionId, string correlationId, int timeoutMs = 5000) { var tcs = new TaskCompletionSource(); From 2a5b716ba041fd6cd790f9cb3b7ace1bcd1e1bb3 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Sun, 21 Jun 2026 23:56:47 +0200 Subject: [PATCH 2/3] Allow NuGet.org for CShells packages Map CShells package IDs to NuGet.org as well as the CShells Feedz source so solution restore can resolve published CShells packages when the Feedz source has no matching package. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- NuGet.Config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NuGet.Config b/NuGet.Config index 6a0629d8a..67a9c924d 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -11,6 +11,8 @@ + + From 635c3ea42f67e89a01b33f4b54015e0102337931 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Mon, 22 Jun 2026 00:44:36 +0200 Subject: [PATCH 3/3] Address PR review feedback Use LINQ for the case-insensitive payload property lookup and keep CShells package source mapping deterministic by mapping CShells packages only to nuget.org. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- NuGet.Config | 4 ---- .../Primitives/Event/PublishEventTests.cs | 17 +++++++++-------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index 67a9c924d..36cf83e1b 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -14,10 +14,6 @@ - - - - diff --git a/test/component/Elsa.Workflows.ComponentTests/Scenarios/Activities/Primitives/Event/PublishEventTests.cs b/test/component/Elsa.Workflows.ComponentTests/Scenarios/Activities/Primitives/Event/PublishEventTests.cs index db0e44fe6..da6ee232f 100644 --- a/test/component/Elsa.Workflows.ComponentTests/Scenarios/Activities/Primitives/Event/PublishEventTests.cs +++ b/test/component/Elsa.Workflows.ComponentTests/Scenarios/Activities/Primitives/Event/PublishEventTests.cs @@ -1,3 +1,4 @@ +using System.Linq; using System.Text.Json; using Elsa.Common.Models; using Elsa.Testing.Shared; @@ -80,17 +81,17 @@ public class PublishEventTests : AppComponentTest private static bool TryGetProperty(JsonElement element, string propertyName, out JsonElement property) { - foreach (var candidate in element.EnumerateObject()) + var candidate = element.EnumerateObject() + .Where(candidate => candidate.Name.Equals(propertyName, StringComparison.OrdinalIgnoreCase)) + .FirstOrDefault(); + if (candidate.Value.ValueKind == JsonValueKind.Undefined) { - if (candidate.Name.Equals(propertyName, StringComparison.OrdinalIgnoreCase)) - { - property = candidate.Value; - return true; - } + property = default; + return false; } - property = default; - return false; + property = candidate.Value; + return true; } private async Task GetSingleWorkflowInstanceAsync(string definitionId, string correlationId, int timeoutMs = 5000)