René's URL Explorer Experiment


Title: fix(inspector): serve source map streams the way Chromium does by edusperoni · Pull Request #2091 · NativeScript/android · GitHub

Open Graph Title: fix(inspector): serve source map streams the way Chromium does by edusperoni · Pull Request #2091 · NativeScript/android

X Title: fix(inspector): serve source map streams the way Chromium does by edusperoni · Pull Request #2091 · NativeScript/android

Description: Source maps served through nsruntime:// (Network.loadNetworkResource + IO.read/IO.close) now follow Chromium's own implementation (DevToolsStreamFile, IOHandler, NetworkHandler::OnLoadNetworkResourceFinished), so VS Code's js-debug and Chrome DevTools see the same behavior they get from Chrome. Same change as NativeScript/ios#548. What was wrong Split characters. IO.read cut the stream every 1 MB without regard for UTF-8. js-debug decodes each chunk on its own, so a character straddling a boundary came out as two U+FFFD in sourcesContent. Breakpoints still bound (mappings are ASCII); the source text js-debug showed was garbled. Streams never freed during a session. js-debug only sends IO.close when the response has a Content-Length header, and none was sent, so every map it loaded stayed in memory until the debugger disconnected. offset was ignored, so only clients that read front to back worked. Behavior now (matches Chromium) Before Now Chunk end every 1 MB a chunk > 6 bytes is trimmed back to the end of its last whole character (port of base::TruncateUTF8ToByteSize) Encoding always base64 text when the whole file is valid UTF-8 (base::IsStringUTF8, which also rejects noncharacters), base64 otherwise; see below for chunks that cut a character offset ignored honored; missing or negative continues from the last read; past the end is eof offset/size type any integer, out-of-range wraps int32, as in Chromium's bindings (5.0 counts); otherwise -32602 Invalid parameters size <= 0 treated as default -32602 Invalid max read size IO.close unknown handle success -32602 Invalid stream handle Stream lifetime until IO.close or disconnect same (Chromium never frees on eof either) loadNetworkResource headers none Content-Length, Content-Type: application/json Honoring offset is safe only together with the boundary trimming. js-debug advances its offset by the UTF-8 length of each decoded chunk, which ran ahead of the real position whenever a character was split. Three choices differ from a literal copy of Chrome: Headers. Chrome's file:// loader sends no Content-Length, so Chrome has the same js-debug leak for file-backed maps. The reply here carries what an HTTP server would send for the file. Chunks that cut a character. A read that starts inside a character, or one of 6 bytes or fewer, can cut a character at an end. Chrome's JSON encoder drops those bytes. Here that one reply is sent as base64 with the exact bytes (base64Encoded is per reply). js-debug and DevTools never read this way. Chunk size. The default stays at 1 MB instead of Chromium's 10 MB to keep socket frames and peak memory small on device. Streams are still dropped on every disconnect: connect() always runs disconnect() first, and websocket close and error both call it. That matches Chromium's DiscardAllStreams on detach. Text chunks now carry raw UTF-8, including 4-byte sequences, back to Java through NewStringUTF, like the V8 inspector messages already do. CheckJNI raised no complaint on API 33. Testing Device suite on a ci_repro_api33 arm64 emulator, run twice: 238 suites, 1468 tests, 0 failures, 4 skipped. An end-to-end CDP client (not committed) over the forwarded -inspectorServer websocket, with generated fixtures: a 5 MB map with a 4-byte emoji straddling the 1 MB boundary, a 3 MB map of mixed 1–4 byte characters, binary data, a map containing U+FFFE, and small and empty maps. 66/66 checks pass: js-debug's read loop reassembles every map exactly with no U+FFFD, and its IO.close succeeds. DevTools' readToBuffer loop reassembles text and binary exactly. Every chunk ends on a character boundary. Seeks, negative offset, past-the-end eof, 7-byte round trips. Reads that cut a character come back as base64 with the exact bytes; 3-byte reads round-trip byte-exactly. int32 and size validation; unknown-handle errors. A stream left open is gone after the client disconnects. Not changed here, pre-existing: AndroidJsV8Inspector.onException calls exception.getMessage().equals(...), which throws a (caught) NullPointerException when a client drops the socket without a close frame. Summary by CodeRabbit Bug Fixes Improved resource reads with optional positions and sizes, consistent chunking, and support for text and binary content. Invalid read parameters and unknown stream handles now return errors instead of being treated as successful requests. Text reads avoid splitting UTF-8 characters, and end-of-stream reads are handled more consistently. Loaded resources now include content length and JSON content-type information.

Open Graph Description: Source maps served through nsruntime:// (Network.loadNetworkResource + IO.read/IO.close) now follow Chromium's own implementation (DevToolsStreamFile, IOHandler, NetworkHandler::OnLoadNetworkRe...

X Description: Source maps served through nsruntime:// (Network.loadNetworkResource + IO.read/IO.close) now follow Chromium&#39;s own implementation (DevToolsStreamFile, IOHandler, NetworkHandler::OnLoadNetwo...

Opengraph URL: https://github.com/NativeScript/android/pull/2091

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:15c826f8-3401-0b97-98fd-a95ea746f7cb
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD4F0:ADA9D:2259C02:2C1626D:6B016DB0
html-safe-noncee6244cdc3b5c434bf1be58f7078dc73fcfdfafc3a20db75c1135784e89875dc6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENEYwOkFEQTlEOjIyNTlDMDI6MkMxNjI2RDo2QjAxNkRCMCIsInZpc2l0b3JfaWQiOiIxMTMzMDA4NjEyMDg4NzA0NDMyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacc67ec1cd6362b5f126142a7b5834e36e3f4fbc02db26ec962a1a6fc4f27bb695
hovercard-subject-tagpull_request:5192328058
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/android/pull/2091/files
twitter:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
og:image:altSource maps served through nsruntime:// (Network.loadNetworkResource + IO.read/IO.close) now follow Chromium's own implementation (DevToolsStreamFile, IOHandler, NetworkHandler::OnLoadNetworkRe...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/android git https://github.com/NativeScript/android.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id29137950
octolytics-dimension-repository_nwoNativeScript/android
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id29137950
octolytics-dimension-repository_network_root_nwoNativeScript/android
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/android/pull/2091/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fpull%2F2091%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fpull%2F2091%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2Fandroid
Reloadhttps://github.com/NativeScript/android/pull/2091/files
Reloadhttps://github.com/NativeScript/android/pull/2091/files
Reloadhttps://github.com/NativeScript/android/pull/2091/files
NativeScripthttps://github.com/NativeScript
androidhttps://github.com/NativeScript/android
Codehttps://github.com/NativeScript/android
Issues106 (106)https://github.com/NativeScript/android/issues
Pull requests26 (26)https://github.com/NativeScript/android/pulls
Actionshttps://github.com/NativeScript/android/actions
Projectshttps://github.com/NativeScript/android/projects
Wikihttps://github.com/NativeScript/android/wiki
Security and qualityhttps://github.com/NativeScript/android/security
Insightshttps://github.com/NativeScript/android/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2Fandroid%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2Fandroid%2Fissues%2Fnew%2Fchoose
edusperonihttps://github.com/edusperoni
mainhttps://github.com/NativeScript/android/tree/main
fix/inspector-io-readhttps://github.com/NativeScript/android/tree/fix/inspector-io-read
Conversation 1 https://github.com/NativeScript/android/pull/2091
Commits 2 https://github.com/NativeScript/android/pull/2091/commits
Checks 8 https://github.com/NativeScript/android/pull/2091/checks
Files changed https://github.com/NativeScript/android/pull/2091/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2091/files
fix(inspector): serve source map streams the way Chromium does https://github.com/NativeScript/android/pull/2091/files#top
Show all changes 2 commits https://github.com/NativeScript/android/pull/2091/files
4d387d5 fix(inspector): serve source map streams the way Chromium does edusperoni Nov 6, 2026 https://github.com/NativeScript/android/pull/2091/commits/4d387d501faaf664f3cbef8ea1d0da32278aa90c
5e23200 fix(inspector): send IO.read chunks that cut a character as base64 edusperoni Nov 6, 2026 https://github.com/NativeScript/android/pull/2091/commits/5e232006007a9953a6bdf50d6f57f69d2b0ab6ad
Clear filters https://github.com/NativeScript/android/pull/2091/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2091/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2091/files
JsV8InspectorClient.cpp https://github.com/NativeScript/android/pull/2091/files#diff-7cc5549c646c336c9433ef2829baa891d29a8322a7043780b8bbcbdb402daacf
JsV8InspectorClient.h https://github.com/NativeScript/android/pull/2091/files#diff-468b021140a72500a8ff6ccc1cd9a05b82beaaf8b46985b8225a87443b6277ad
test-app/runtime/src/main/cpp/JsV8InspectorClient.cpphttps://github.com/NativeScript/android/pull/2091/files#diff-7cc5549c646c336c9433ef2829baa891d29a8322a7043780b8bbcbdb402daacf
View file https://github.com/NativeScript/android/blob/5e232006007a9953a6bdf50d6f57f69d2b0ab6ad/test-app/runtime/src/main/cpp/JsV8InspectorClient.cpp
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2091/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2091/files#diff-7cc5549c646c336c9433ef2829baa891d29a8322a7043780b8bbcbdb402daacf
https://github.com/NativeScript/android/pull/2091/files#diff-7cc5549c646c336c9433ef2829baa891d29a8322a7043780b8bbcbdb402daacf
https://github.com/NativeScript/android/pull/2091/files#diff-7cc5549c646c336c9433ef2829baa891d29a8322a7043780b8bbcbdb402daacf
https://github.com/NativeScript/android/pull/2091/files#diff-7cc5549c646c336c9433ef2829baa891d29a8322a7043780b8bbcbdb402daacf
https://github.com/NativeScript/android/pull/2091/files#diff-7cc5549c646c336c9433ef2829baa891d29a8322a7043780b8bbcbdb402daacf
https://github.com/NativeScript/android/pull/2091/files#diff-7cc5549c646c336c9433ef2829baa891d29a8322a7043780b8bbcbdb402daacf
https://github.com/NativeScript/android/pull/2091/files#diff-7cc5549c646c336c9433ef2829baa891d29a8322a7043780b8bbcbdb402daacf
https://github.com/NativeScript/android/pull/2091/files#diff-7cc5549c646c336c9433ef2829baa891d29a8322a7043780b8bbcbdb402daacf
test-app/runtime/src/main/cpp/JsV8InspectorClient.hhttps://github.com/NativeScript/android/pull/2091/files#diff-468b021140a72500a8ff6ccc1cd9a05b82beaaf8b46985b8225a87443b6277ad
View file https://github.com/NativeScript/android/blob/5e232006007a9953a6bdf50d6f57f69d2b0ab6ad/test-app/runtime/src/main/cpp/JsV8InspectorClient.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2091/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2091/files#diff-468b021140a72500a8ff6ccc1cd9a05b82beaaf8b46985b8225a87443b6277ad
https://github.com/NativeScript/android/pull/2091/files#diff-468b021140a72500a8ff6ccc1cd9a05b82beaaf8b46985b8225a87443b6277ad
https://github.com/NativeScript/android/pull/2091/files#diff-468b021140a72500a8ff6ccc1cd9a05b82beaaf8b46985b8225a87443b6277ad
https://github.com/NativeScript/android/pull/2091/files#diff-468b021140a72500a8ff6ccc1cd9a05b82beaaf8b46985b8225a87443b6277ad
https://github.com/NativeScript/android/pull/2091/files#diff-468b021140a72500a8ff6ccc1cd9a05b82beaaf8b46985b8225a87443b6277ad
Please reload this pagehttps://github.com/NativeScript/android/pull/2091/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.