Skip to content

ScheduleNewWorkflowAsync should accept DateTimeOffset? for startTime #1576

@frankbuckley

Description

@frankbuckley

DurableTask StartOrchestrationOptions takes a DateTimeOffset? value for StartAt. However, DaprWorkflowClient.ScheduleNewWorkflowAsync accepts a DateTime?.

This is likely to lead to bugs where times are interpreted as being in the local time zone (where the workflow process is running) when the request to start the workflow may have originated from a user in a different time zone.

ScheduleNewWorkflowAsync should accept DateTimeOffset? for startTime.

Although this changes a shipped public method, it is arguably not breaking as it simply exposes the implicit conversion that is currently happening here (line 63):

public Task<string> ScheduleNewWorkflowAsync(
string name,
string? instanceId = null,
object? input = null,
DateTime? startTime = null)
{
StartOrchestrationOptions options = new(instanceId, startTime);
return this.innerClient.ScheduleNewOrchestrationInstanceAsync(name, input, options);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions