Open RobertConanMcMillan opened 4 months ago
When reading an entry from a CosmosDB backed state store, properties are returned in seemingly random order, often shuffled differently on each fetch.
This breaks System.Text.Json polymorphism, as the $type (or other delimiter) must be the first property read in an object.
System.Text.Json
$type
The JSON should not be modified or altered, when read from the state store.
When the value:
{ "$type": "some-type", "value": "some-value" }
Is stored in the state store, get state should return:
Is stored in the state store, get state will randomly return either:
or
{ "value": "some-value" "$type": "some-type" }
state.azure.cosmosdb
RELEASE NOTE: FIX CosmosDB state returns shuffled JSON
The Dapr API does not make any guarantees about the ordering of fields. This is not part of our API contract @RobertConanMcMillan. Therefore I do not see this as a bug.
However, I'm happy to accept PRs.
When reading an entry from a CosmosDB backed state store, properties are returned in seemingly random order, often shuffled differently on each fetch.
This breaks
System.Text.Json
polymorphism, as the$type
(or other delimiter) must be the first property read in an object.Expected Behavior
The JSON should not be modified or altered, when read from the state store.
When the value:
Is stored in the state store, get state should return:
Actual Behavior
When the value:
Is stored in the state store, get state will randomly return either:
or
Steps to Reproduce the Problem
state.azure.cosmosdb
state storeRelease Note
RELEASE NOTE: FIX CosmosDB state returns shuffled JSON