Skip to content

fix: interpret policy InitialStart values as UTC - #64

Merged
sebastian-ederer merged 1 commit into
mainfrom
fix/initial_start_timezone_bug
Sep 4, 2026
Merged

fix: interpret policy InitialStart values as UTC #64
sebastian-ederer merged 1 commit into
mainfrom
fix/initial_start_timezone_bug

Conversation

@sebastian-ederer

Copy link
Copy Markdown
Member

Description

InitialStart values are now interpreted and stored as UTC. Previously, InitialStart strings and DateTime values were converted to the local time of the machine generating the migration, making snapshots and migration files timezone-dependent - teams working across time zones saw phantom policy migrations for the same instant. Now all paths normalize to UTC and render machine-independent DateTimeKind.Utc literals. Two effects to be aware of:

  • InitialStart strings without a timezone suffix (and DateTime values with Kind.Unspecified) are now interpreted as UTC instead of machine-local time. If you relied on an unsuffixed value meaning local time, append an explicit offset (e.g. +02:00) or Z to state your intent.

  • Snapshots written by earlier versions store local wall-clock values without their originating zone. Regenerating a migration on the same machine (or timezone) that produced the snapshot upgrades seamlessly; regenerating on a machine in a different timezone produces one final AlterXxxPolicy diff — review that the resulting UTC instant is the one you intended, after which the snapshot is UTC and permanently stable. This cross-machine case produced phantom diffs on every regeneration before this release; now it happens at most once.

Type of Change

  • Bug fix (non-breaking change addressing an issue)
  • New feature (non-breaking change adding functionality)
  • Refactoring
  • Documentation
  • CI / build / tooling
  • Breaking change (fix or feature causing existing functionality to change)

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated (Testcontainers)
  • Existing tests pass (dotnet test)

Checklist

  • Code follows the project's coding styles and guidelines
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • No new compiler warnings introduced
  • Public API changes have XML documentation

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sebastian-ederer
sebastian-ederer merged commit f07e811 into main Sep 4, 2026
3 checks passed
@sebastian-ederer
sebastian-ederer deleted the fix/initial_start_timezone_bug branch September 4, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant