Skip to content

Zero execution context ID passed in Debugger.scriptParsed event #34639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aeulitz opened this issue Sep 9, 2022 · 2 comments
Closed

Zero execution context ID passed in Debugger.scriptParsed event #34639

aeulitz opened this issue Sep 9, 2022 · 2 comments
Labels
Needs: Triage 🔍 p: Microsoft Partner: Microsoft Partner Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@aeulitz
Copy link
Contributor

aeulitz commented Sep 9, 2022

Description

Code in ReactCommon causes the Debugger.scriptParsed event to carry a zero executionContextId. This does not line up with the execution context ID in the ExecutionContextDescription arg of the Runtime.executionContextCreated event.

Version

0.70.0

Output of npx react-native info

System:
OS: Windows 10 10.0.22000
CPU: (32) x64 AMD Ryzen Threadripper PRO 3955WX 16-Cores
Memory: 104.50 GB / 127.86 GB
Binaries:
Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.18 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
IDEs:
Android Studio: Not Found
Visual Studio: 17.2.32802.462 (Visual Studio Enterprise 2022), 16.11.32802.440 (Visual Studio Enterprise 2019)
Languages:
Java: 11.0.12 - C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin\javac.EXE
npmPackages:
@react-native-community/cli: ^9.0.0-alpha.9 => 9.0.0-alpha.9
react: 18.1.0 => 18.1.0
react-native: Not Found
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. Run a ReactNative app using Hermes direct debugging.
  2. Monitor CDP WebSocket messages with an appropriate packet tracer (e.g. Wireshark, Chrome DevTools protocol monitor).
  3. Attach Chrome DevTools to ReactNative app.
  4. Compare execution context ID in Runtime.executionContextCreated and Debugger.scriptParsed event.

Result:
Execution context ID in Runtime.executionContextCreated represents real context ID, execution context ID in Debugger.scriptParsed event is always zero.

Expected Result:
Execution context IDs in both CDP events should match.

Snack, code example, screenshot, or link to a repository

Compare
https://github.com/facebook/react-native/blob/main/ReactCommon/hermes/inspector/chrome/Connection.cpp#L394
to
https://github.com/facebook/react-native/blob/main/ReactCommon/hermes/inspector/chrome/Connection.cpp#L314

facebook-github-bot pushed a commit that referenced this issue Sep 12, 2022
Summary:
As generated by ReactCommon code, the CDP [Debugger.scriptParsed](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-scriptParsed) event carries a zero execution context ID. It should match the execution context ID contained in the []() argument of the [Runtime.executionContextCreated](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#event-executionContextCreated) event. Tracking issue is RN:34639](#34639).

## Changelog

[General] [Changed] - Correct execution context ID in Debugger.scriptParsed event.

Pull Request resolved: #34640

Test Plan: Verified via packet tracer (Wireshark, Chrome DevTools protocol monitor) that Debugger.scriptParsed carries execution context ID.

Reviewed By: jpporto

Differential Revision: D39385622

Pulled By: mattbfb

fbshipit-source-id: 9060041cfa2a784adf4ad371fbe63f530e3362ad
@github-actions
Copy link

github-actions bot commented Mar 8, 2023

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 8, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@facebook facebook locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Triage 🔍 p: Microsoft Partner: Microsoft Partner Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants