Skip to content

fix(pipeline): add browser guards and retry coverage for intercept/tap#393

Open
Astro-Han wants to merge 1 commit intojackwener:mainfrom
Astro-Han:fix/pr4-pipeline
Open

fix(pipeline): add browser guards and retry coverage for intercept/tap#393
Astro-Han wants to merge 1 commit intojackwener:mainfrom
Astro-Han:fix/pr4-pipeline

Conversation

@Astro-Han
Copy link
Copy Markdown
Contributor

@Astro-Han Astro-Han commented Mar 24, 2026

Description

Harden intercept and tap pipeline steps so that missing browser sessions produce a clear ConfigError instead of an opaque TypeError, and transient browser disconnects are retried automatically.

Three concrete fixes:

  • Browser guard: stepIntercept() and stepTap() now throw ConfigError with a hint when page is null, placed after existing early-returns so no-op paths (empty capture / missing params) are preserved
  • Timeout bug: intercept had Math.min(timeout, 3) which silently capped the wait to 3s regardless of config; now passes timeout through directly (default changes from 3s to 8s)
  • Retry coverage: added intercept and tap to BROWSER_STEPS in executor.ts, giving them 2 retries on transient browser errors (extension disconnect, CDP connection loss, etc.)

download is intentionally excluded from retry expansion; its internal error handling swallows cookie failures, so adding it to BROWSER_STEPS would be nominal coverage with no real retry effect. That needs its own design.

Related issue: none found

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🌐 New site adapter
  • 📝 Documentation
  • ♻️ Refactor
  • 🔧 CI / build / tooling

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful

Screenshots / Output

npx tsc --noEmit   # clean
npx vitest run src/

 Test Files  29 passed (29)
      Tests  297 passed (297)

- Add ConfigError guard to stepIntercept() and stepTap() when page is null
- Fix timeout truncation bug: Math.min(timeout, 3) → timeout (default 3s → 8s)
- Add intercept/tap to BROWSER_STEPS for transient disconnect retry
- Remove all page! non-null assertions after guard narrows type
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