Skip to content

inspector: auto collect webstorage data#62145

Merged
nodejs-github-bot merged 9 commits intonodejs:mainfrom
islandryu:autoCollectWebStorage
Apr 6, 2026
Merged

inspector: auto collect webstorage data#62145
nodejs-github-bot merged 9 commits intonodejs:mainfrom
islandryu:autoCollectWebStorage

Conversation

@islandryu
Copy link
Copy Markdown
Member

@islandryu islandryu commented Mar 7, 2026

Web Storage data collection, which previously required explicitly firing events to send data to DevTools, is now performed automatically within Node.js.
Web Storage will appear in DevTools simply by specifying --experimental-storage-inspection, without requiring any code changes.

This feature relies on the changes introduced in the following change request, so it can be verified with the latest DevTools commit:
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7274801

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/inspector

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. 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 Mar 7, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 7, 2026

Codecov Report

❌ Patch coverage is 93.71728% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.69%. Comparing base (a6e9e32) to head (57f5b49).
⚠️ Report is 244 commits behind head on main.

Files with missing lines Patch % Lines
src/inspector/dom_storage_agent.cc 82.05% 1 Missing and 6 partials ⚠️
src/node_webstorage.cc 77.27% 1 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62145      +/-   ##
==========================================
+ Coverage   89.64%   89.69%   +0.04%     
==========================================
  Files         676      677       +1     
  Lines      206240   206871     +631     
  Branches    39514    39618     +104     
==========================================
+ Hits       184891   185544     +653     
+ Misses      13465    13451      -14     
+ Partials     7884     7876       -8     
Files with missing lines Coverage Δ
lib/internal/inspector/webstorage.js 100.00% <100.00%> (ø)
lib/internal/webstorage.js 100.00% <100.00%> (ø)
src/node_builtins.cc 75.95% <ø> (ø)
src/node_webstorage.h 83.33% <ø> (ø)
src/node_webstorage.cc 74.81% <77.27%> (+0.07%) ⬆️
src/inspector/dom_storage_agent.cc 67.74% <82.05%> (+18.06%) ⬆️

... and 102 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.

Comment thread src/inspector/dom_storage_agent.cc Outdated
Comment thread src/inspector/dom_storage_agent.cc Outdated
Comment thread src/inspector/dom_storage_agent.cc
Comment thread src/node_webstorage.cc Outdated
Comment thread src/node_webstorage.cc Outdated
Copy link
Copy Markdown
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

Looks good!

I'd still recommend adding a test for UTF-16 characters outside the ISO-8859-1 range (e.g. emoji or Chinese characters)

@addaleax addaleax added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 8, 2026
@github-actions github-actions bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Mar 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 8, 2026

Failed to start CI
- Validating Jenkins credentials
✔  Jenkins credentials valid
- Starting PR CI job
✘  Failed to start PR CI: 404 Not Found
https://github.com/nodejs/node/actions/runs/22820941170

@aduh95
Copy link
Copy Markdown
Contributor

aduh95 commented Mar 8, 2026

Related test failure:

Path: parallel/test-code-cache
Error: --- stderr ---
node:internal/bootstrap/realm:185
      mod = bindingObj[module] = getInternalBinding(module);
                                 ^

Error: No such binding: webstorage

You probably need to skip that test when compiled without SQLite

@islandryu islandryu force-pushed the autoCollectWebStorage branch from 8e0c41b to b278ecc Compare March 9, 2026 04:34
@islandryu
Copy link
Copy Markdown
Member Author

I changed the implementation to handle the storage keys and values as UTF-16.

@islandryu islandryu force-pushed the autoCollectWebStorage branch from b278ecc to 8fc09a7 Compare March 9, 2026 05:21
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Comment thread src/inspector/dom_storage_agent.cc Outdated
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@Renegade334 Renegade334 removed the request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. label Mar 10, 2026
Comment thread src/inspector/dom_storage_agent.cc Outdated
is_local_storage ? local_storage_map_ : session_storage_map_;
std::optional<StorageMap> storage_map =
is_local_storage ? std::make_optional<StorageMap>(local_storage_map_)
: std::make_optional<StorageMap>(session_storage_map_);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is still making full copies – that's proably fine for a inspector feature, but it's an unnecessary set of extra allocations

@addaleax addaleax added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 10, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 10, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Comment thread src/inspector/dom_storage_agent.cc Outdated
Co-authored-by: Anna Henningsen <github@addaleax.net>
@addaleax addaleax added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Mar 21, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 26, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@islandryu islandryu added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Apr 6, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 6, 2026
@nodejs-github-bot nodejs-github-bot merged commit d93935b into nodejs:main Apr 6, 2026
75 checks passed
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Landed in d93935b

jasnell pushed a commit that referenced this pull request Apr 6, 2026
Signed-off-by: Ali Hassan <ali-hassan27@outlook.com>
PR-URL: #62616
Refs: #62145
Refs: #62162
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
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. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants