Skip to content

inspector: add protocol methods retrieving sent/received data - #58645

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
legendecas:inspector/data-sent-api
Jun 20, 2025
Merged

inspector: add protocol methods retrieving sent/received data#58645
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
legendecas:inspector/data-sent-api

Conversation

@legendecas

Copy link
Copy Markdown
Member

Add protocol method Network.dataSent to buffer request data. And
expose protocol methods Network.getRequestPostData and
Network.getResponseBody allowing devtool to retrieve buffered data.

@nodejs-github-botnodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Jun 9, 2025
Add protocol method `Network.dataSent` to buffer request data. And
expose protocol methods `Network.getRequestPostData` and
`Network.getResponseBody` allowing devtool to retrieve buffered data.
@legendecas
legendecasforce-pushed the inspector/data-sent-api branch from 0d15711 to 5b2f8a5CompareJune 9, 2025 11:56
@legendecaslegendecas added the inspector Issues and PRs related to the V8 inspector protocol label Jun 9, 2025
@codecov

codecovBot commented Jun 9, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 80.12048% with 33 lines in your changes missing coverage. Please review.

Project coverage is 90.15%. Comparing base (b23648e) to head (5b2f8a5).
Report is 64 commits behind head on main.

Files with missing linesPatch %Lines
src/inspector/network_agent.cc68.31%16 Missing and 16 partials ⚠️
lib/internal/inspector/network.js95.23%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #58645 +/- ##
========================================
Coverage 90.15% 90.15% ========================================
Files 636 637 +1 Lines 187891 188001 +110 Branches 36879 36899 +20 ========================================
+ Hits 169386 169493 +107 + Misses 11272 11245 -27 - Partials 7233 7263 +30 
Files with missing linesCoverage Δ
lib/inspector.js96.94% <100.00%> (+0.01%)⬆️
lib/internal/inspector/network_http.js95.23% <100.00%> (+0.68%)⬆️
lib/internal/inspector/network_undici.js94.40% <100.00%> (+0.65%)⬆️
src/inspector/network_agent.h100.00% <100.00%> (ø)
lib/internal/inspector/network.js94.66% <95.23%> (+0.22%)⬆️
src/inspector/network_agent.cc63.47% <68.31%> (-0.31%)⬇️

... and 40 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@legendecas

Copy link
Copy Markdown
MemberAuthor

@nodejs/inspector would you mind taking a look? Thank you!

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@legendecaslegendecas added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 20, 2025
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 20, 2025
@nodejs-github-bot
nodejs-github-bot merged commit 5a14ea6 into nodejs:mainJun 20, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 5a14ea6

@legendecas
legendecas deleted the inspector/data-sent-api branch June 20, 2025 10:34
RafaelGSS pushed a commit that referenced this pull request Jun 23, 2025
Add protocol method `Network.dataSent` to buffer request data. And
expose protocol methods `Network.getRequestPostData` and
`Network.getResponseBody` allowing devtool to retrieve buffered data.
PR-URL: #58645
Reviewed-By: Ryuhei Shima <shimaryuhei@gmail.com>
aduh95 pushed a commit that referenced this pull request Jul 21, 2025
Add protocol method `Network.dataSent` to buffer request data. And
expose protocol methods `Network.getRequestPostData` and
`Network.getResponseBody` allowing devtool to retrieve buffered data.
PR-URL: #58645
Reviewed-By: Ryuhei Shima <shimaryuhei@gmail.com>
aduh95 pushed a commit that referenced this pull request Jul 24, 2025
Add protocol method `Network.dataSent` to buffer request data. And
expose protocol methods `Network.getRequestPostData` and
`Network.getResponseBody` allowing devtool to retrieve buffered data.
PR-URL: #58645
Reviewed-By: Ryuhei Shima <shimaryuhei@gmail.com>
@capJavert

capJavert commented Jan 22, 2026

Copy link
Copy Markdown

@legendecas sorry for tagging, but I have a question, from my usage looks like this implementation covers Network.getResponseBody on raw text response, but if body is compressed (eg. gzip, br) it shows like this in Node.js inspector network tab:
image

From my understanding we could hook into auto decompress option in http client and then use that depending on conent-encoding in getResponseBody.

Just trying to figure out if this is intended or missed?

@legendecas

Copy link
Copy Markdown
MemberAuthor

@capJavert yes, there is a PR #61226 for this issue.

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

Labels

inspectorIssues and PRs related to the V8 inspector protocollib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@legendecas@nodejs-github-bot@capJavert@islandryu