[DevTools] Network panel truncates response bodies containing multibyte UTF-8 characters
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- android, ios, javascript, react-native
- 领域
- devtools, networking
调研方向
Start by reproducing with a fetch() call to an endpoint returning the example JSON with multibyte characters, then compare the response body's byte length with its character length along the path that serves Network.getResponseBody over CDP. The payload names no source files or tests, so locating the truncation point is the first real task. Done means the Network panel's Response and Preview tabs show the full body for a body containing multibyte UTF-8 characters.
由索引模型根据 Issue 内容生成。
描述
Description
In the React Native DevTools Network panel, response bodies containing multibyte UTF-8
characters (e.g. á, é, ó) are displayed truncated in both the Response and
Preview tabs.
The number of missing trailing characters matches the number of multibyte characters in
the body, which suggests a byte-length vs. character-length mismatch when the response
preview is stored or served via CDP (Network.getResponseBody).
- ASCII-only responses render correctly.
- The app itself receives the full, valid body — only the DevTools preview is affected.
- Because the JSON is cut, Preview cannot parse it and falls back to raw text.
- Reproducible on both iOS and Android.
Steps to reproduce
- Serve an endpoint returning:
{"m":["Inténtelo de nuevo más tarde"]}
- Call it with
fetch()from the app while React Native DevTools is open. - Open the Network panel → select the request → Response / Preview tab.
Expected behavior
The full body is displayed:
{"m":["Inténtelo de nuevo más tarde"]}
Actual behavior
The body is cut short by N characters, where N is the number of multibyte characters it
contains. In the example above (2 multibyte chars), the closing "]} is missing or
partially missing, so the JSON is invalid and Preview shows raw text.
Real-world example: a 120-character body with 3 multibyte characters (ó, é, á) is
missing exactly its last 3 characters ("]}).
React Native Version
0.84.1
Affected Platforms
Runtime - iOS, Runtime - Android
Tested on iOS Simulator (iPhone 18 Pro, iOS 27) and Android emulator. New Architecture and
Hermes enabled on both.
Output of npx @react-native-community/cli info
System:
OS: macOS 27.0.1
CPU: (15) arm64 Apple M5 Pro
Memory: 87.63 MB / 24.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.18.0
path: ~/.asdf/installs/nodejs/22.18.0/bin/node
Yarn:
version: 1.22.22
path: ~/.asdf/installs/nodejs/22.18.0/bin/yarn
npm:
version: 10.9.3
path: ~/.asdf/plugins/nodejs/shims/npm
Watchman:
version: 2026.04.27.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK:
Platforms:
- DriverKit 27.0
- iOS 27.0
- macOS 27.0
- tvOS 27.0
- visionOS 27.0
- watchOS 27.0
Android SDK: Not Found
IDEs:
Android Studio: 2025.3 AI-253.32098.37.2534.15232325
Xcode:
version: 27.0/27A266a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.19
path: /usr/bin/javac
Ruby:
version: 3.2.3
path: ~/.asdf/shims/ruby
npmPackages:
"@react-native-community/cli":
installed: 20.1.2
wanted: 20.1.2
react:
installed: 19.2.3
wanted: 19.2.3
react-native:
installed: 0.84.1
wanted: 0.84.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
Stacktrace or Logs
N/A — no errors are thrown; the response preview is silently truncated.
Screenshots and Videos
- 主要语言
- JavaScript
- 星标
- 5.6k
- 派生
- 702
- 平均合并
- 3 天 2 小时
- 30 天内合并 PR
- 57
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
react/metro 的其他 Issue
-
constant-folding-plugin emits 0/0 (NaN) for arithmetic on destructured bindings可能已有人在做 @cpruijsen 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
[0.83.x] Backport micromatch removal and dotfile/multipart watcher fix together可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 2 天内回复
-
`dependencies is not iterable` / `Cannot read property 'reduce' of undefined`: `FileStore` serves zero-prefixed cache files as hits可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
维护者通常 2 天内回复
-
Async chunk URLs drop the file extension, so .cjs async imports fail with "Requiring unknown module"可能已有人在做 @dasjideepak 于 18 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 74/100
react/metro#1959 · 2 条评论 · 2 个 reaction ·
维护者通常 2 天内回复
-
Files changed during startup can be missed until restart可能已有人在做 @cpruijsen 于 6 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 2 天内回复
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 76/100
SasanLabs/VulnerableApp#836 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
keyxmakerx/Chronicle#1469 ·
维护者通常 1 天内回复
-
Connection.prototype.bulkWrite() with ordered: false resolves null when a write fails可能已有人在做 @maxymlyskov 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
Automattic/mongoose#16601 ·
维护者通常 2 天内回复
-
sandbox-vercel: persistent: false is dropped for live sandboxes created from a template, so every stop writes a snapshot可能已有人在做 @jvg123 今天认领。 未关闭factory-active task-identify-harness-labels-done task-identify-issue-type-done
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复