Skip to content

fix(common): preserve zero optional durations - #2249

Open
sidsri14 wants to merge 1 commit into
temporalio:mainfrom
sidsri14:fix-ms-optional-zero-duration
Open

fix(common): preserve zero optional durations#2249
sidsri14 wants to merge 1 commit into
temporalio:mainfrom
sidsri14:fix-ms-optional-zero-duration

Conversation

@sidsri14

Copy link
Copy Markdown

What changed

Updated msOptionalToTs to treat only null and undefined as absent values, so a numeric 0 duration is preserved and converted to a zero protobuf timestamp.

Added a unit test covering msOptionalToTs(0).

Fixes #2233.

Validation

  • npx --yes pnpm@10.27.0 --filter @temporalio/proto build
  • npx --yes pnpm@10.27.0 --filter @temporalio/common build
  • npx --yes pnpm@10.27.0 --filter @temporalio/common test
  • npx --yes pnpm@10.27.0 exec eslint packages/common/src/time.ts packages/common/src/__tests__/test-time.ts
  • npx --yes pnpm@10.27.0 prettier --check packages/common/src/time.ts packages/common/src/__tests__/test-time.ts

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sidsri14
sidsri14 marked this pull request as ready for review July 27, 2026 13:30
@sidsri14
sidsri14 requested a review from a team as a code owner July 27, 2026 13:30
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.

msOptionalToTs() drops Duration=0 (falsy guard bug) — silently ignores nextRetryDelay:0 on ApplicationFailure

2 participants