Skip to content

Validate PerformanceObserver callbacks - #58239

Closed
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/validate-performance-observer-callback
Closed

OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/validate-performance-observer-callback

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary:

PerformanceObserver currently accepts missing and non-function callbacks, creating invalid instances that fail only when native delivery tries to invoke the stored value. Validate construction synchronously, distinguish an omitted required argument from an explicitly supplied non-function, and cover both error paths.

Fixes #58238.

Changelog:

[GENERAL] [FIXED] - Reject missing and non-function PerformanceObserver callbacks during construction.

Test Plan:

  • Exact upstream focused regression: both new constructor assertions failed.
  • Fixed Fantom suite: 5 passed with one pre-existing skip.
  • Fresh Flow check: 0 errors.
  • Targeted no-ignore ESLint, Prettier, and git diff --check passed.

Invalid constructor calls now throw synchronously as required; valid callers and UI behavior are unchanged.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 30, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 30, 2026
@javache
javache requested a review from rubennorte September 1, 2026 09:46
@meta-codesync

meta-codesync Bot commented Oct 7, 2026

Copy link
Copy Markdown

@rubennorte has imported this pull request. If you are a Meta employee, you can view this in D123889539.

@meta-codesync meta-codesync Bot closed this in c2da175 Oct 7, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Oct 7, 2026
@meta-codesync

meta-codesync Bot commented Oct 7, 2026

Copy link
Copy Markdown

@rubennorte merged this pull request in c2da175.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PerformanceObserver accepts invalid callbacks until delivery

1 participant