Skip to content

fix: harden network interception and bump to 1.3.3 - #46

Merged
AmisKwok merged 3 commits into
mainfrom
fix/inspector-robustness-v1.3.3
Aug 10, 2026
Merged

fix: harden network interception and bump to 1.3.3#46
AmisKwok merged 3 commits into
mainfrom
fix/inspector-robustness-v1.3.3

Conversation

@AmisKwok

@AmisKwok AmisKwok commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary / 摘要

Harden network interception (cryptographic request-ID uniqueness, 512 KB body cap to prevent OOM, safe binary/non-UTF-8 handling) and bump the package and iOS podspec to 1.3.3. / 加固网络拦截(加密级请求 ID 唯一性、512 KB 请求体上限防 OOM、安全的二进制/非 UTF-8 处理),并将包与 iOS podspec 版本提升至 1.3.3。

Changes / 变更

  • Unify request-ID generation in InspectorHttpClient and InspectorDioInterceptor to microsecond timestamp + Random.secure() + monotonic counter, eliminating duplicate IDs under concurrency. / 统一 InspectorHttpClientInspectorDioInterceptor 的请求 ID 生成为「微秒时间戳 + Random.secure() + 自增计数器」,消除并发下的重复 ID。
  • Cap captured request body at 512 KB and record a truncation note to avoid OOM on large uploads. / 对请求体设置 512 KB 上限并记录截断提示,避免大文件上传时 OOM。
  • Fall back safely on non-UTF-8 / binary response bodies instead of throwing. / 对二进制 / 非 UTF-8 响应体做安全回退,避免解析抛错。
  • Show "unknown size" when contentLength == -1 in InspectorResponseProxy. / InspectorResponseProxycontentLength == -1 时显示 unknown size。
  • Bump pubspec.yaml to 1.3.3 and ios/zero_inspector_kit.podspec to 1.3.3 (was stale at 1.2.2). / pubspec.yaml 升至 1.3.3,ios/zero_inspector_kit.podspec 升至 1.3.3(此前停留在 1.2.2)。
  • Update README, README_zh, docs/Installation, and CHANGELOG to 1.3.3. / 同步更新 README、README_zh、docs/Installation 与 CHANGELOG 至 1.3.3。
  • Add tests: request_id_collision_test.dart, http_interceptor_test.dart, and a concurrent-ID uniqueness group in models_test.dart. / 新增测试:request_id_collision_test.darthttp_interceptor_test.dart,以及 models_test.dart 中的并发 ID 唯一性测试组。

Context / 背景

Three Trae-generated branches (trae/agent-Ovp5X2, trae/agent-g6rcvw, trae/agent-q9jzwN) each patched part of the same interception robustness issues with overlapping/conflicting edits. They were consolidated into this single branch (Ovp5X2's lib implementation kept as the base, g6rcvw's and q9jzwN's tests merged in) so the fixes ship together in one release. / 三个 Trae 分支各自只修补了同一组拦截健壮性问题的一部分且改动相互冲突,已整合到本分支(以 Ovp5X2 的 lib 实现为基础,合并 g6rcvw 与 q9jzwN 的测试),以便随同一版本发布。

Checklist / 检查项

  • Title follows Conventional Commits / 标题符合约定式提交
  • CI checks pass after merge / 合入后 CI 通过

Test plan

  • flutter analyze passes / flutter analyze 通过
  • flutter test passes (173 tests) / flutter test 通过(173 项)
  • dart format . reports no changes / dart format . 无改动

🤖 Generated with Zero Buddy

@AmisKwok
AmisKwok merged commit b040ae6 into main Aug 10, 2026
9 checks passed
@AmisKwok
AmisKwok deleted the fix/inspector-robustness-v1.3.3 branch August 10, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant