In `PurgeInstancesFilter`, can `CreatedFrom` be null while `CreatedTo` is not null?
- Dominant language
- C#
- Stars
- 1.7k
- Forks
- 335
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 6
Description
In [this constructor](https://learn.microsoft.com/en-us/dotnet/api/microsoft.durabletask.client.purgeinstancesfilter.-ctor?view=durabletask-dotnet-1.x#microsoft-durabletask-client-purgeinstancesfilter-ctor(system-nullable((system-datetimeoffset))-system-nullable((system-datetimeoffset))-system-collections-generic-ienumerable((microsoft-durabletask-client-orchestrationruntimestatus)))), we have both `CreatedFrom` and `CreatedTo` nullable, however, when I create one with `new PurgeInstancesFilter(null, createdTimeTo, runtimeStatus)`, and call `PurgeAllInstancesAsync` with the created option, I got an exception. I know I can avoid this by using `DateTimeOffset.MinValue` but I would expect `null` to be equivalent to `MinValue`.
Looking around, the following code looks suspicious to me:
- https://github.com/microsoft/durabletask-sidecar/blob/551a76a428905ce887844976b79bf39d1b31cf4d/src/DurableTask.Sidecar/Grpc/ProtobufUtils.cs#L396C56-L396C57
- https://github.com/Azure/durabletask/blob/5fbfbfb2b7bb4f3be60e547ace7d06607c22845a/src/DurableTask.Core/PurgeInstanceFilter.cs#L40C16-L40C24
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.