Skip to content

fix: contain routed preview fetch failures#2096

Merged
chubes4 merged 1 commit into
mainfrom
fix-2094-route-fetch-redaction
Jul 26, 2026
Merged

fix: contain routed preview fetch failures#2096
chubes4 merged 1 commit into
mainfrom
fix-2094-route-fetch-redaction

Conversation

@chubes4

@chubes4 chubes4 commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • contain routed preview transport failures inside the Playwright route callback so they cannot become unhandled rejections
  • retry transient document requests up to three total attempts and subresources up to two, then fail documents with safe classified diagnostics or abort subresources
  • redact sensitive header lines, query values, error messages, and stacks before tracking, serialization, artifact persistence, or command propagation

Fixes #2094

Security impact

Routed browser fetch failures could previously persist browser-session authentication material through Playwright request call logs. This change removes secret-bearing header values and URL parameters at the shared redaction boundary and sanitizes every affected browser error path before it can reach tracker errors, stdout/stderr, diagnostics, manifests, artifacts, or snapshots. Tests use synthetic sentinels only.

Root cause

isBrowserPreviewRouteFetchRecoverableError() recognized disposal and decompression failures but not transient upstream transport failures. The route callback then tracked and rethrew the original Playwright error, allowing a rejected route handler and its request call log to escape into process-level stderr.

Retry and redaction design

  • classify reset, refusal, timeout, broken-pipe, and socket-close failures as recoverable transport errors
  • use deterministic 25ms/50ms retry spacing with three total document attempts and two total subresource attempts
  • preserve existing immediate-abort behavior for disposed contexts and decompression failures
  • never rethrow from the Playwright route callback; required document failures surface later through the drained route tracker as a sanitized BrowserPreviewRouteFetchError
  • extend the generic redactor to replace complete sensitive header assignments and add a reusable sanitized Error projection

Compatibility

Existing redirect routing, disposal/decompression recovery, liveness handling, and advisory/required route-drain semantics remain intact. Non-routed traffic is unchanged.

Test results

  • npm run build passed
  • npm run test:redaction passed
  • npm run test:browser-preview-routing passed (6 tests)
  • npm run test:browser-accessibility-oracles passed (42 tests)
  • npm run test:browser-diagnostic-providers passed
  • npm run test:browser-callback-materialization-contracts passed
  • npm run test:browser-artifact-session passed
  • npm run test:production-boundary-enforcement passed
  • git diff --check passed
  • npm run check reached the pre-existing wordpress.collect-workload-result outputShape should mention outputSchema id failure tracked in command-registry-smoke fails on main: wordpress.collect-workload-result outputShape missing outputSchema id mention #1745; the production-boundary phase and build passed before that unrelated assertion

@chubes4
chubes4 merged commit 6445ee1 into main Jul 26, 2026
4 checks passed
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.

Routed fetch ECONNRESET crashes runtime and exposes auth cookies in logs

1 participant