Skip to content

Fix structuredClone test and added test to clarify behavior in IntersectionObserver#51476

Closed
rubennorte wants to merge 1 commit into
facebook:mainfrom
rubennorte:export-D75073118
Closed

Fix structuredClone test and added test to clarify behavior in IntersectionObserver#51476
rubennorte wants to merge 1 commit into
facebook:mainfrom
rubennorte:export-D75073118

Conversation

@rubennorte
Copy link
Copy Markdown
Contributor

Summary:
Changelog: [internal]

When we added integration of IntersectionObserver in the event loop by default, we changed the timing of the observer notification:

  • Before, it was scheduled synchronously from the observe call. That means that, if you schedule another task immediately after the observe call, the order is IO callback then task.
  • After, it was scheduled at the end of the current event loop tick. That means that, if you schedule another task immediately after the observe call, the order is task then IO callback.

This change in order wasn't accounted for in the tests for IO (which it's added here) and made a test for structuredClone break because it was using incorrect assumptions.

This fixes that test.

Differential Revision: D75073118

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels May 20, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D75073118

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D75073118

…ectionObserver (facebook#51476)

Summary:
Pull Request resolved: facebook#51476

Changelog: [internal]

When we added integration of IntersectionObserver in the event loop by default, we changed the timing of the observer notification:
- Before, it was scheduled synchronously from the `observe` call.  That means that, if you schedule another task immediately after the observe call, the order is IO callback then task.
- After, it was scheduled at the end of the current event loop tick. That means that, if you schedule another task immediately after the observe call, the order is task then IO callback.

This change in order wasn't accounted for in the tests for IO (which it's added here) and made a test for `structuredClone` break because it was using incorrect assumptions.

This fixes that test.

Reviewed By: rshest

Differential Revision: D75073118
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D75073118

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label May 20, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 6581c69.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @rubennorte in 6581c69

When will my fix make it into a release? | How to file a pick request?

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. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants