Skip to content

fix(network): retain HTTP redirect responses in capture - #538

Draft
u7-u7 wants to merge 1 commit into
Tencent:mainfrom
u7-u7:fix/network-redirect-responses-20261031
Draft

u7-u7 wants to merge 1 commit into
Tencent:mainfrom
u7-u7:fix/network-redirect-responses-20261031

Conversation

@u7-u7

@u7-u7 u7-u7 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Problem

The read-only bsk network command omits HTTP redirect responses. Chrome reports those in Network.requestWillBeSent.redirectResponse, rather than a separate responseReceived event. The existing listener replaces the previous request's metadata without recording its response. A POST → 303 → GET workflow therefore loses the 303 and original POST in its network evidence; multi-hop redirects lose every intermediate response.

Change

Record a redirect response through the existing bounded network buffer before replacing the request metadata. Preserve the old hop's method, the redirect's URL/status and event timestamp; keep subsequent response/failure attribution and incremental cursors intact. If capture begins mid-chain, the old method remains unknown instead of being misreported as the next request's method.

No protocol, permissions, request interception, or page-action behavior changes.

Verification

  • Regression on unmodified main 9cfba53582cb04d48da36aabd0a5017987d4daea: failed, returning no redirect entry instead of the POST/303 response.
  • Final ChromiumCdp + network-handler suites: 82 passed.
  • Extension TypeScript check, production WXT build, Biome check of both changed files and git diff --check: passed.
  • First complete extension test run: 3,374 passed, 335 skipped, one failure in the unchanged 10 ms file-drop timeout test. That test separately passed 30/30 with the unmodified production source. The final full rerun with --maxWorkers=2 passed: 3,375 passed, 335 skipped (192 test files passed, 39 skipped). The original failure is retained here rather than attributed to an unproven cause.

Tests drive the production ChromiumCdp event listener and buffer using the repository's debugger-API test double. No live Chrome/CLI round trip, Rust workspace tests, or full monorepo lint were run. The production build retains the existing large-chunk warning.

AI assistance

Prepared and tested with OpenAI Codex. Draft for maintainer review; no human-review attestation is claimed.

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