Skip to content
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

inspector: provide detailed network information to fix devtools frontend errors #54156

Merged
merged 4 commits into from
Aug 5, 2024

Conversation

cola119
Copy link
Member

@cola119 cola119 commented Aug 1, 2024

ref #53593 (comment)

This PR addresses and resolves specific errors occurring in the ChromeDevTools frontend, as reported at issues.chromium.org.

The error being fixed are as follows:

NetworkManager.ts:758 Uncaught TypeError: Cannot read properties of undefined (reading 'headers')
    at NetworkDispatcher.responseReceived (NetworkManager.ts:758:71)
    at DispatcherManager.dispatch (InspectorBackend.ts:1114:11)
    at Target.dispatch (InspectorBackend.ts:566:16)
    at SessionRouter.onMessage (InspectorBackend.ts:447:22)
    at WebSocketConnection.#socket.onmessage (Connections.ts:90:24)

These errors occur because Node.js doesn't provide the necessary debug information (such as request/response headers and content type) to the frontend during network inspection. Without this information, the Chrome DevTools frontend cannot properly handle and display network requests, leading to the aforementioned errors. To resolve the issue, the change in this PR ensure that Node.js supplies the required debugging information to the frontend. Specifically,

  • Adding request and response headers.
  • Adding response information.
  • Providing the resource type for network responses.
image

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Aug 1, 2024
@cola119 cola119 added the inspector Issues and PRs related to the V8 inspector protocol label Aug 1, 2024
@nodejs-github-bot

This comment was marked as outdated.

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 94.28571% with 4 lines in your changes missing coverage. Please review.

Project coverage is 87.06%. Comparing base (e7edcf3) to head (e02aaa7).
Report is 31 commits behind head on main.

Files Patch % Lines
src/inspector/network_agent.cc 92.10% 2 Missing and 1 partial ⚠️
lib/internal/inspector_network_tracking.js 96.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54156      +/-   ##
==========================================
- Coverage   87.07%   87.06%   -0.01%     
==========================================
  Files         643      643              
  Lines      181582   181652      +70     
  Branches    34891    34910      +19     
==========================================
+ Hits       158111   158157      +46     
- Misses      16751    16767      +16     
- Partials     6720     6728       +8     
Files Coverage Δ
lib/internal/inspector_network_tracking.js 95.74% <96.87%> (+0.50%) ⬆️
src/inspector/network_agent.cc 93.97% <92.10%> (-2.03%) ⬇️

... and 35 files with indirect coverage changes

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@cola119 cola119 added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Aug 1, 2024
@cola119 cola119 requested a review from legendecas August 1, 2024 10:38
Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM % one comment.

lib/internal/inspector_network_tracking.js Outdated Show resolved Hide resolved
@cola119 cola119 added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 2, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 2, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@cola119 cola119 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed needs-ci PRs that need a full CI run. labels Aug 3, 2024
@cola119 cola119 added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 5, 2024
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Aug 5, 2024
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/54156
✔  Done loading data for nodejs/node/pull/54156
----------------------------------- PR info ------------------------------------
Title      inspector: provide detailed network information to fix devtools frontend errors (#54156)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     cola119:fix-ni-frontend-error -> nodejs:main
Labels     c++, inspector, author ready, commit-queue-squash
Commits    4
 - inspector: provide detailed info to fix DevTools frontend errors
 - inspector: support `Network.Response.statusText` property
 - inspector: delete unused declarations in header file for cleanup
 - inspector: convert a header object to a simple string dictionary
Committers 1
 - cola119 <kohei.ueno119@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/54156
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/54156
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Thu, 01 Aug 2024 06:29:33 GMT
   ✔  Approvals: 1
   ✔  - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/54156#pullrequestreview-2215047386
   ✘  This PR needs to wait 76 more hours to land (or 0 hours if there is one more approval)
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2024-08-02T22:33:18Z: https://ci.nodejs.org/job/node-test-pull-request/60840/
- Querying data for job/node-test-pull-request/60840/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/10241284324

@cola119 cola119 removed the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Aug 5, 2024
@legendecas
Copy link
Member

/cc @nodejs/inspector would you mind taking a look at this?

@legendecas legendecas added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 5, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 5, 2024
@nodejs-github-bot nodejs-github-bot merged commit 3616ace into nodejs:main Aug 5, 2024
65 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 3616ace

@cola119 cola119 deleted the fix-ni-frontend-error branch August 5, 2024 13:23
targos pushed a commit that referenced this pull request Aug 14, 2024
PR-URL: #54156
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
@RafaelGSS RafaelGSS mentioned this pull request Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. inspector Issues and PRs related to the V8 inspector protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants