temporalio / sdk-dotnet

Temporal .NET SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] DataConverter should not eagerly instantiate payload/failure converter from type

cretz opened this issue · comments

Describe the bug

Using DataConverter.Default with { PayloadConverterType = typeof(MyPayloadConverter) } means internally .NET does a clone (shallow using internal copy constructor) then sets the property at which point it's too late to set the PayloadConverter. Can probably just make the payload/failure converter properties Lazy (PublicationOnly because it is expected that multiple instantiations of payload/failure converter can occur).