Skip to content

fix: network capture, WebSocket/gRPC, log interception and UI bug fixes - #108

Merged
AmisKwok merged 3 commits into
mainfrom
fix/inspector-capture-and-ui-bugs
Sep 20, 2026
Merged

AmisKwok merged 3 commits into
mainfrom
fix/inspector-capture-and-ui-bugs

Conversation

@AmisKwok

@AmisKwok AmisKwok commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

Summary / 摘要

Fix multiple network-capture correctness bugs (https URL on non-443 ports, Content-Length mismatch in pass-through request-body rule, responses never consumed staying pending, WebSocket/gRPC records never persisted, done returning a different response proxy), plus async errors missed under the init() + wrapApp() two-liner and a memory-leak false-positive without VM Service. / 修复多处网络抓取正确性 bug(非 443 端口的 https URL、直传请求体规则 Content-Length 错配、响应体未消费时永远停在 pending、WebSocket/gRPC 记录从不落盘、done 返回不同响应代理),以及两行式集成漏捕的异步异常、无 VM Service 时的内存泄漏误报。

Changes / 变更

  • Network capture correctness fixes (https on non-443, no Content-Length rewrite in pass-through, persist status when body unconsumed, shared response proxy, mixed add()/addStream()) / 网络抓取多项正确性修复
  • WebSocket / gRPC records now persist with a synthetic status code; handshake GET shows when WS capture disabled / WebSocket / gRPC 记录落盘,关闭时补状态码
  • Log interception captures uncaught async Future/Stream errors via a global isolate listener / 日志拦截通过全局 Isolate 监听捕获未捕获的异步异常
  • NetworkRequest.toJson uses jsonEncode for Map/List bodies / toJson 对 Map/List 体改用 jsonEncode
  • No auto memory-leak flag without VM Service / 无 VM Service 不再自动判内存泄漏
  • UI fixes: stale dock-animation listener, ThrottledNotifier Timer fallback, Dio fallback record, first error-carrying database result kept / 悬浮按钮、节流通知、Dio 回退、数据库首错结果等 UI 修复
  • Bump to 1.12.1 and update README / CHANGELOG / docs / 版本升到 1.12.1 并更新文档

Context / 背景

These were the highest-frequency correctness and crash reports from real usage: captured requests stuck in pending, wrong cURL export for non-443 https, async exceptions silently lost, and memory-leak false positives on release/real-device builds. / 这些是真实使用中最频繁的正确性/崩溃反馈:抓取请求卡在 pending、非 443 https 导出 cURL 错误、异步异常静默丢失、release/真机下内存泄漏误报。

Checklist / 检查项

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

Test plan

  • flutter analyze and flutter test green on CI / CI 上 analyze 与 test 通过
  • Verify a non-443 https request exports the correct https:// cURL / 验证非 443 https 请求导出正确的 https cURL
  • Verify WebSocket/gRPC records appear in the network list and export archive / 验证 WS/gRPC 记录出现在网络列表与导出存档

🤖 Generated with Zero Buddy

AmisKwok and others added 3 commits September 21, 2026 04:41
- Network capture: record https URL on non-443 ports correctly, stop rewriting Content-Length in pass-through request-body rule, persist status code when response body is never consumed, share one response proxy between done/close, and handle mixed add()/addStream().

- WebSocket/gRPC: synthesize status code on close/call completion so records persist and are not lost from exported session archives; handshake GET shows as a normal request when WS capture is disabled.

- Log interception: capture uncaught async Future/Stream errors via a global isolate listener (the old runZonedGuarded was dead code).

- NetworkRequest.toJson uses jsonEncode for Map/List bodies so exports parse back.

- Memory: no auto leak flag without VM Service to avoid false positives.

- UI: remove stale dock-animation listener, Timer fallback in ThrottledNotifier when backgrounded, keep Dio fallback record, and preserve first error-carrying database provider result.

- Bump version to 1.12.1 (pubspec, podspec, inspector_version) and update README/CHANGELOG.
- The 1.12.1 change gates the leaked transition on _vmServiceAvailable to avoid false positives without VM Service (release / real-device). The test now asserts leaked when VM Service is present and stays �erifying when it is not, matching the new behavior on CI runners.
@AmisKwok
AmisKwok merged commit 0cf48df into main Sep 20, 2026
7 checks passed
@AmisKwok
AmisKwok deleted the fix/inspector-capture-and-ui-bugs branch September 20, 2026 20:58
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