Repository navigation
fix(browser): keep failed trace response statuses unknown - #12724
Conversation
Use the recorded HTTP response owner for Playwright trace headlines. Preserve producer status sentinels and failure facts in the raw record, without presenting unavailable responses as observed HTTP status codes.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Low impact] The reviewed changes appear safe to merge. SummaryTrace network headlines now use
No actionable code or security issues were found. No tests were run during this review. Whether another PR supersedes this one could not be checked because GitHub access was unavailable. Reviews (3) · Last reviewed commit: "fix(browser): keep failed trace response..." · Reviewed by Greptile |
Summary
Keep unavailable Playwright trace response statuses unknown instead of presenting
-1as an observed HTTP status.Problem and expected behavior
Playwright 1.64.1 initializes HAR/trace responses with
status: -1; a request that fails before headers retains that sentinel. REA currently publishes it as the trace event's HTTP status and reports scoped interpretation. Preserve the source failure while leaving the headline status unknown and reporting partial interpretation.Change and scope
Reuse the recorded response declaration owner already used by HAR consumers. This follows the HTTP-status semantics from #12218; that merged change did not update the trace projection. No issue is linked because this remaining path was independently reproduced. No new provider or runtime capability.
Contract and boundary impact
TraceEventProjectiondelegates status interpretation toreadRecordedResponseDeclaration; trace views consume the resulting facts.Expected effects:
Evidence and regression coverage
Decoder-boundary fixture fails on main
c0ee832a3: 1 failed / 19 passed. It incorrectly returns[-1, 0, 99, 200.5, 1000]as status headlines.After the fix: invalid/sentinel headlines are null, valid 100/200/600/999 remain, raw
-1and its lexeme/failure/provenance survive, and coverage is partial.Actual producer run: Playwright 1.64.1 / Chromium 156.0.8078.4 on macOS arm64, isolated browser and a self-owned loopback server that closes
/failedbefore headers. Its recorded trace reproducesstatus: -1,net::ERR_EMPTY_RESPONSE, and scoped interpretation with no baseline diagnostic. The fixed production decoder returns null/partial with a line-2 diagnostic while preserving the raw failure, exact member/line provenance and valid 200/101 peers. Its resource scope closed with no pending resources. A separate authored ZIP regression covers the invalid-number and valid-boundary controls.Boundary coverage: missing/unknown values, source preservation and valid controls. No lifecycle behavior changes.
Observed, derived, and inferred claims remain distinguishable.
Artifact identity, source provenance, and failed attempts remain preserved.
Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.
Validation performed
Node 24.22.1 / npm 11.16.0, macOS arm64.
npm run test:local -- src/browser/history/playwrightTrace/PlaywrightTraceDecoder.test.ts src/domain/analysisView/webNetworkCaptureView.test.ts— 83 passed, private TMPDIR.npm run typecheck— passed (source and script projects).npm run lint— passed, zero errors; advisory warnings remain.npm run check:fast— passed through the normal pre-push hook, including typecheck, lint and architecture guards.oxlint/oxfmt --check,npm run verify:test-discovery,git diff --check— passed; discovery includes the new regression.npm run check— failed environmentally during compile with ENOSPC creating the MCP catalog temporary directory; not reported as passing. Its full formatting check passed. The source typecheck/lint commands above were then run independently.Compatibility, safety, and release
No migration, dependency or release metadata changes. Real browser generation and production decoder checks ran as described above. The supported public CLI launcher was attempted but failed because the compiled runtime was missing after an interrupted build; no successful public CLI workflow was established. Public MCP and other browser/platform lanes were not run. An earlier focused attempt failed before test collection because shared temporary Vite files disappeared; the private-TMPDIR run above completed. CI and the remaining full static gate still need completion.
Author readiness
Human owner: Chessing234
Before merge