Skip to content

fix(environment): make Temporal.Now deterministic during workflow replay - #285

Draft
ianmacartney wants to merge 2 commits into
mainfrom
ian/patch-temporal-now
Draft

ianmacartney wants to merge 2 commits into
mainfrom
ian/patch-temporal-now

Conversation

@ianmacartney

@ianmacartney ianmacartney commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Workflow replay patched Date.now() but left Temporal.Now reading the runtime clock, so timestamps used in step arguments could change during replay. Patch all Temporal.Now clock methods to use the workflow generation timestamp, with millisecond precision, UTC defaults, and support for explicit time zones.

Preserve the original Temporal namespace for restoration and skip runtimes without Temporal. Add unit and workflow integration coverage using a development-only polyfill, document the behavior, and flag Performance APIs and argumentless Intl.DateTimeFormat calls as follow-up gaps.

Validation after rebasing onto origin/main: all 176 tests pass; build and typecheck pass; lint passes with three existing warnings.

ianmacartney commented Sep 15, 2026 •

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ianmacartney ianmacartney changed the title Update eslint monorepo to v10 (#202) fix(environment): make Temporal.Now deterministic during workflow replay Sep 15, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@convex-dev/workflow@285

commit: 13c78fc

@ianmacartney
ianmacartney force-pushed the ian/patch-temporal-now branch from 1101e08 to 13c78fc Compare November 24, 2026 06:36
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