Skip to content

fix(network): preserve request metadata for response body failures - #435

Open
ch-z-hc wants to merge 2 commits into
Tencent:mainfrom
ch-z-hc:fix/network-body-failure-metadata
Open

ch-z-hc wants to merge 2 commits into
Tencent:mainfrom
ch-z-hc:fix/network-body-failure-metadata

Conversation

@ch-z-hc

@ch-z-hc ch-z-hc commented Oct 13, 2026

Copy link
Copy Markdown

Network capture discards request metadata at Network.responseReceived, but that event only means headers arrived. If the response body subsequently fails, the Network.loadingFailed entry loses its URL, method and resource type. This makes truncated downloads and interrupted fetches harder to diagnose with bsk network.

Keep the existing bounded metadata until loadingFinished or loadingFailed. Response entries are still recorded immediately; tab isolation and detach cleanup are unchanged. The regression now checks attribution after a response and verifies cleanup after successful loading.

Verified with an isolated headless Chrome profile and a local HTTP server that sends HTTP 200 and an incomplete body: Chrome emits responseReceived, then loadingFailed with net::ERR_CONTENT_LENGTH_MISMATCH for the same request. The updated attribution test fails on unchanged source and passes with this patch.

Validation on Windows / Node 24.14.0 / pnpm 10.17.0:

  • CDP and network handler tests: 62 passed.
  • Full extension suite: 2583 passed, 233 existing conditional skips. i18n: 64 passed; VOM: 82 passed.
  • Extension typecheck and production build passed. Biome, Stylelint and DSH typecheck passed.
  • pnpm lint is not fully green: its DSH suite has 492 passed and 2 failed in tests/runner.test.ts. Both failures reproduce in an unmodified 4c8616b worktree under the same environment. No assertions, timeouts or skip conditions were relaxed. Rust tests and the full opt-in browser matrix were not run.

Codex assisted with investigation, implementation and testing. This has not had an independent human code review.

@ch-z-hc
ch-z-hc marked this pull request as ready for review October 14, 2026 08:22

This branch has not been deployed

No deployments
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