Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versioning: Fix AsTime() for a nil proto timestamp #1847

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

antlai-temporal
Copy link
Contributor

What was changed

A nil Google protobuf for a timestamp returns with AsTime() a year 1970, making IsZero() false, since
Go time.Time expects year 1.
This PR checks for nil timestamps and returns time.Time{} for them in the new versioning API.

Checklist

  1. Closes
    AsTime() on a nil pointer converts to Jan. 1st, 1970 at midnight UTC #1846
  2. How was this tested:

A unit-test added.

@antlai-temporal antlai-temporal requested a review from a team as a code owner February 25, 2025 01:43
@antlai-temporal antlai-temporal merged commit 61c10ce into temporalio:master Feb 25, 2025
13 checks passed
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.

2 participants