Skip to content

Temporal use same time as Date.now() + compat flag & tests - #6943

Merged
npaun merged 1 commit into
mainfrom
npaun/re-temporalize
Oct 29, 2026
Merged

npaun merged 1 commit into
mainfrom
npaun/re-temporalize

Conversation

@npaun

@npaun npaun commented Aug 10, 2026

Copy link
Copy Markdown
Member

No description provided.

@npaun
npaun requested review from a team as code owners August 10, 2026 14:04
@ask-bonk

ask-bonk Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

Comment thread src/workerd/jsg/resource.c++
@codspeed

This comment was marked as low quality.

@npaun
npaun force-pushed the npaun/re-temporalize branch 2 times, most recently from 2d9e447 to 16cc49e Compare August 10, 2026 18:25
@npaun
npaun force-pushed the npaun/re-temporalize branch from 16cc49e to d731e3a Compare October 28, 2026 23:31
@clanky-the-clanker

Copy link
Copy Markdown

💬 Approved with comments — No correctness, security or performance problems found. The Temporal gating defaults to off, and Temporal.Now now uses the same coarse clock as Date.now(). The only item is an optional documentation suggestion.

Findings: 1 suggestion

The decision is advisory: this comment never approves, blocks or requests changes on the pull request.


📖 AGENTS.md: 💬 1 suggestion

The JSG guidance could record the new Temporal context-gating and clock invariant.

Recommendation: 💬 Optional Nits

  • [SUGGESTION] Document the per-context Temporal gating and the rule that Temporal.Now must read the same coarse clock as Date.now() in src/workerd/jsg/AGENTS.md. (src/workerd/jsg/resource.c++:70)
View full review

src/workerd/jsg/resource.c++ explains that V8 installs Temporal process-wide and that Temporal must read the same coarse clock as Date.now(). A short note in src/workerd/jsg/AGENTS.md would keep this constraint visible for future V8 updates.


✅ All other checks passed

🔒 Security: ✅ LGTM

No security issues found. Without the callback, Temporal.Now reads the same coarse clock as Date.now() (the Spectre timer mitigation), and temporal-test.js checks this.


📋 Code Quality: ✅ LGTM

enableTemporal defaults to false and the server path sets it from the temporal feature flag. The per-isolate bootstrap context is created through newContext, so the deletion applies there too. The two v8::Context::New calls in io/worker.c++ that bypass newContext are a compile-only dummy context and a throwaway inspector context; neither runs Worker code. Both new tests set their compatibility flags explicitly, so they don't depend on the default compat date.


⚡ Performance: ✅ LGTM

No performance issues found.


📝 Documentation: ✅ LGTM

No documentation issues found.


Reviewed commit: d731e3a0

@npaun
npaun merged commit e9e1914 into main Oct 29, 2026
26 of 28 checks passed
@npaun
npaun deleted the npaun/re-temporalize branch October 29, 2026 00:49
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