You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds live network monitoring and HAR export to the NativeScript inspector, with native request-metric streaming.
Changes:
Adds Network panel rendering and HAR export.
Streams metrics through the inspector WebSocket.
Adds runtime capture state, serialization, and delivery APIs.
File
Changes and final findings
utils/nativejsinspector.html
Adds Network UI and HAR export. Moderate:harPickTiming misinterprets explicit *Ms values (3 votes); rendering 2,000 rows per request causes O(n²) DOM work (1 vote); disconnect does not disable capture (2 votes); Transfer size uses outgoing headers (1 vote); HAR timestamps use export time instead of request time (1 vote).
src/jsc/JavaScriptUtils.cpp
Adds metric capture and toggle behavior. Critical: inspector capture remains gated by environment variables (3 votes); ETHAN_LOGGING_PIPE changes collection and logging behavior, exposing request metadata (1 vote). Moderate:JSRuntimeDownloadMetrics breaks its existing query contract (3 votes).
src/jsc/JavaScriptContext.cpp
Adds metric serialization and forwarding. Critical: callbacks access connections and send WebSocket data off the owning thread, risking races and lifetime errors (1 vote). Moderate: legacy metric dumping is skipped without inspector capture (3 votes); streaming unconditionally appends metrics to the log, causing I/O, growth, and metadata exposure (1 vote).
src/InspectorHTTPServer.cpp
Adds network event delivery. Critical:onMetricsData accesses connections off the inspector thread and can race with unref/send operations (2 votes).
include/jsc/JavaScriptContext.h
Adds capture-state declarations. Moderate: declares std::mutex without directly including <mutex> (1 vote).
Environment-enabled network diagnostics are incorrectly discarded
src/jsc/JavaScriptContext.cpp:671
When NATIVEJS_DUMP_NETWORKMETRIC or ETHAN_LOGGING_PIPE is set, the request producer still creates metrics, but mNetworkCaptureEnabled starts false unless the inspector sends the new setter. This branch deletes those metrics, so the existing environment-driven diagnostics no longer collect anything in headless or non-inspector runs; preserve the environment opt-in separately from the inspector flag.
HAR content length reports request size as response size
utils/nativejsinspector.html:459
entry.headers is serialized from rtHttpRequest::headers() (the outgoing request headers), so a Content-Length found here is the upload/request-body length, not the response transfer size shown by this column. POST/PUT rows will report the wrong direction; use a response size metric or response headers, or label this as request size.
Every exported entry is assigned the time of the HAR export, not when that request occurred. A HAR containing multiple completed requests therefore loses request chronology and makes all requests appear to start simultaneously; record the capture timestamp with each streamed metric and use it here.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🟡 Changes recommended
Unresolved critical connection-lifetime and public-binding compatibility issues, along with capture, privacy, and HAR correctness issues, block approval.
Get a fresh assessment by requesting another Copilot review.
NetworkMetrics.headers is populated from rtHttpRequestEx::headers() (the outgoing request…
utils/nativejsinspector.html:459
NetworkMetrics.headers is populated from rtHttpRequestEx::headers() (the outgoing request headers), not response headers. Consequently a request body's Content-Length can be shown as the response transfer size, even though it is unrelated to downloaded bytes. Only use a response byte metric/header here, or omit this shortcut rather than reporting a misleading size.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.