Repository navigation
Conversation
Use the existing safe clock for the profile envelope timestamp so CPU profile flushes do not violate Cache Components prerender restrictions. Cover the read with a guarded-clock regression test. Co-Authored-By: OpenAI GPT-6 <codex@openai.com>
Contributor
Author
|
@chargome, thanks for the go-ahead in #26431. The draft PR includes the safe timestamp change and a guarded-clock regression test that fails before the fix and passes after it; the full profiling suite also passes. GitHub did not allow me to submit a reviewer request with my current permissions, so I am mentioning you here as invited. |
Closed
3 tasks done
andreiborza
marked this pull request as ready for review
November 17, 2026 12:53
Member
|
bugbot run |
andreiborza
approved these changes
Nov 17, 2026
andreiborza
left a comment
Member
There was a problem hiding this comment.
LGTM, thank you for the contribution @JavierCane.
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 255e083. Configure here.
msonnb
pushed a commit
that referenced
this pull request
Nov 17, 2026
This PR adds the external contributor to the CHANGELOG.md file, so that they are credited for their contribution. See #26474 Co-authored-by: chargome <20254395+chargome@users.noreply.github.com>
51 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Prevent CPU profile flushes from reading the ambient clock during Next.js Cache Components prerendering. The regression test rejects both zero-argument
new Date()andDate.now()outside the safe context and verifies a valid envelope timestamp.Why
The profiling package has its own envelope-header builder, which was not covered by the core timestamp fix in #21351 for #21333. #21510 and #21573 address random-ID setup in build workers; this path already has the safe runner available but bypasses it when creating
sent_at.Using core's existing
safeDateNow()follows the responsibility split in #18700: Next.js supplies the safe context and shared SDK code uses it without importing the framework. It also keeps the escape limited to a telemetry timestamp, consistent with gnoff's warning about broader context escapes.Maintainer go-ahead.
Validated with
pnpm run format,pnpm run build:dev,pnpm run lint, and the profiling package's type-aware lint and full test suite (27 tests, including worker integration). The regression fails before the fix and passes after it. An additional test-program typecheck reports the same five pre-existing diagnostics with and without this test; the new test typechecks independently.Closes #26431