Skip to content

Fix timezone-dependent ArgumentOutOfRangeException in WorkflowState#1690

Merged
WhitWaldo merged 3 commits intodapr:masterfrom
daanschutte:daanshutte/workflow-state-test
Feb 2, 2026
Merged

Fix timezone-dependent ArgumentOutOfRangeException in WorkflowState#1690
WhitWaldo merged 3 commits intodapr:masterfrom
daanschutte:daanshutte/workflow-state-test

Conversation

@daanschutte
Copy link
Contributor

@daanschutte daanschutte commented Feb 2, 2026

Description

In WorkflowState, implicit conversion of default(DateTime) to DateTimeOffset can throw ArgumentOutOfRangeException in non-UTC timezones due to underflow. This PR makes the conversion explicit and deterministic by treating workflow metadata timestamps as UTC and guarding against default(DateTime).

Issue reference

Please reference the issue this PR will close: #1689

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@daanschutte daanschutte requested review from a team as code owners February 2, 2026 12:52
Copy link
Contributor

@WhitWaldo WhitWaldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - happy to merge once tests pass.

@WhitWaldo WhitWaldo merged commit e6563fc into dapr:master Feb 2, 2026
73 checks passed
@WhitWaldo
Copy link
Contributor

@daanschutte Thank you for identifying and putting this PR together!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WorkflowState CreatedAt/LastUpdatedAt throws in non-UTC timezones (DateTime.MinValue → DateTimeOffset)

2 participants