dotnet / orleans

Cloud Native application framework for .NET
https://docs.microsoft.com/dotnet/orleans
MIT License
9.89k stars 2.01k forks source link

Brings back support for `StringData` in ATS provider #8965

Closed ledjon-behluli closed 1 week ago

ledjon-behluli commented 1 month ago

Currently the Azure Table Storage provider saves the grain state (encoded JSON) but in binary format- Regardless if the orleans serializer or one of the two json serializer are used. And while it can be decoded as UTF-8, its cumbersome to do that when someone wants to manually intervene and change the data in ATS. Let alone just a quick way to simply look at the data.

This PR brings back StringData but with the difference that its does NOT use Newtonsoft.Json to serialize the data as it was previously, but instead uses the GrainStorageSerializer and converts the BinaryData to a string format. This allows the data to follow what ever grain storage serializer is configured by the user i.e.: Newtonsoft.JsonorSystem.Text.Json`.

AFAIK this is not a breaking change, as we'll continue to read both formats for backwards compatibility.

Microsoft Reviewers: Open in CodeFlow
ledjon-behluli commented 1 month ago

Pic of it in action

image

ledjon-behluli commented 2 weeks ago

I'll address both points

ledjon-behluli commented 1 week ago

@benjaminpetit i've addressed both points, sorry for the delay! Have a look at the test specifically the comment I left, let me know if my reasoning makes sense to you.

ledjon-behluli commented 1 week ago

@ReubenBond it would be awesome if this could be merged :)