Add idempotency tests for trigger indexing and fix serialization mismatch in WorkflowTriggerEqualityComparer#7320
Conversation
…atch in WorkflowTriggerEqualityComparer 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Greptile SummaryThis PR fixes a critical serialization mismatch bug in Key changes:
Impact: This fix prevents unnecessary delete-reinsert cycles during trigger indexing, which eliminates a race condition window that could cause unique constraint violations in multi-pod environments. Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| src/modules/Elsa.Workflows.Runtime/Comparers/WorkflowTriggerEqualityComparer.cs | Fixed serialization mismatch by adding camelCase naming policy and payload normalization to match IPayloadSerializer behavior |
| test/component/Elsa.Workflows.ComponentTests/Scenarios/TriggerIndexingIdempotency/TriggerIndexingIdempotencyTests.cs | Added comprehensive component tests verifying idempotency of trigger indexing and trigger ID preservation |
| test/unit/Elsa.Workflows.Runtime.UnitTests/Comparers/WorkflowTriggerEqualityComparerTests.cs | Added thorough unit tests documenting the serialization mismatch bug and verifying the fix works correctly |
Last reviewed commit: 51d3f70
Additional Comments (1)
Current test uses simple record types, so this isn't caught. Consider adding these converters or test with payloads containing |
…reation with helper methods and extract serializer options to static fields for clarity.
…imeSpan, and polymorphic objects in serializer options.
Summary
WorkflowTriggerEqualityComparerto properly compare workflow triggersWorkflowTriggerEqualityComparerto verify equality comparison logicTest plan
TriggerIndexingIdempotencyTestscomponent testsWorkflowTriggerEqualityComparerTestsunit tests🤖 Generated with Claude Code