elsa-core/test/integration/Elsa.Workflows.IntegrationTests
Robin Sue c4a6ce2796 Fix Primitive Collection serialization
This was broken by both #5871 and #5682:
1. When a List<Guid> was serialized, it was recognized as a primitive collection and thus plainly written to the JSON without any type information: ["d4d8404c-4357-47ff-a343-649a116539f5"]
2. When this JSON was deserialized, due to lack of type info, it was deserialized as List<object>, containing strings. This is already not good.
3. When this List<object> gets serialized again (e.g. due to multiple workflow suspends causing WorkflowState serialization), this time it fails the primitive collection recognition, because object is not a primitive type. It now gets serialized as {"_items": ["d4d8404c-4357-47ff-a343-649a116539f5"], "_type": "Object[]"}
4. When that JSON gets deserialized, it tries to ReadType() but ReadType() fails to parse Object[] since it lacks the logic from TypeJsonConverter to throw away the [] before looking up Object in the WellKnownTypeRegistry, so it returns null as a type. Without a type but being faced with a json object { ... } it now deserializes into an ExpandoObject
5. Any further serialization / deserializations will now cause the expando object to get nested deeper and deeper every time.
2024-12-04 15:47:01 +01:00
..
Activities Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
Core Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
Scenarios Implement multitenant HTTP routing (#6031) 2024-10-14 21:27:11 +02:00
Serialization Fix Primitive Collection serialization 2024-12-04 15:47:01 +01:00
Elsa.Workflows.IntegrationTests.csproj Rename Elsa.ProtoActor to Elsa.Workflows.Runtime.ProtoActor 2024-07-22 15:09:25 +02:00
Elsa.Workflows.IntegrationTests.csproj.DotSettings Fix WorkflowExecutionContext bug (#4919) 2024-02-09 19:37:37 +01:00
Usings.cs Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00