temporalio / sdk-dotnet

Temporal .NET SDK
MIT License
375 stars 30 forks source link

Wrong casting in several classes #274

Closed StanislavPrusac closed 2 months ago

StanislavPrusac commented 2 months ago

Within the class ScheduleOptions method Clone() casting is done via the class WorkflowOptions, and I think maybe ScheduleOptions should be used: https://github.com/temporalio/sdk-dotnet/blob/d3f38172112ddf0c855ad1ab9a9878432eb5dc4b/src/Temporalio/Client/Schedules/ScheduleOptions.cs#L45

Maybe I misunderstood something, but there are also a number of strange castings in these other classes: https://github.com/temporalio/sdk-dotnet/blob/d3f38172112ddf0c855ad1ab9a9878432eb5dc4b/src/Temporalio/Client/Schedules/ScheduleTriggerOptions.cs#L26

https://github.com/temporalio/sdk-dotnet/blob/d3f38172112ddf0c855ad1ab9a9878432eb5dc4b/src/Temporalio/Client/WorkflowHistoryFetchOptions.cs#L34

https://github.com/temporalio/sdk-dotnet/blob/d3f38172112ddf0c855ad1ab9a9878432eb5dc4b/src/Temporalio/Client/Schedules/ScheduleListOptions.cs#L22

https://github.com/temporalio/sdk-dotnet/blob/d3f38172112ddf0c855ad1ab9a9878432eb5dc4b/src/Temporalio/Client/WorkflowCancelOptions.cs#L21

cretz commented 2 months ago

Thank you! This is an obvious (embarrassing) bug on our part and we will fix shortly.