Skip to content

fix: retry transient browser navigation failures#27

Merged
intel352 merged 2 commits into
mainfrom
fix/playwright-navigation-retry
Jun 6, 2026
Merged

fix: retry transient browser navigation failures#27
intel352 merged 2 commits into
mainfrom
fix/playwright-navigation-retry

Conversation

@intel352
Copy link
Copy Markdown
Contributor

@intel352 intel352 commented Jun 6, 2026

Summary

  • Retry Playwright page.goto when Chromium reports transient navigation errors such as net::ERR_NETWORK_CHANGED.
  • Keep non-transient failures, including Amazon interstitial/manual-review failures, fail-closed.
  • Add a regression test for the retry path.

Root cause

workflow-compute staging proof run 27072615705 accepted and launched the v0.1.14 product-capture runtime, but the provider exited with:

product capture: playwright capture failed: page.goto: net::ERR_NETWORK_CHANGED

The provider had no retry around browser navigation, so a transient network transition inside the sandbox failed the whole workload.

TDD proof

With fix absent:

$ GOWORK=off go test ./internal/provider -run TestPlaywrightScriptRetriesTransientNavigationFailures
FAIL — missing isTransientNavigationError retry path

With fix restored:

$ GOWORK=off go test ./internal/provider -run TestPlaywrightScriptRetriesTransientNavigationFailures
ok github.com/GoCodeAlone/workflow-plugin-product-capture/internal/provider

Verification

  • GOWORK=off go test ./internal/provider -run 'TestPlaywrightScriptRetriesTransientNavigationFailures|TestPlaywrightScriptDoesNotAutomateInterstitialOrAdvertiseStealth|TestPlaywrightScriptWaitsForVisibleProductTitleSpan|TestPlaywrightScriptWaitsForCaptureRelevantNodes'\n- GOWORK=off go test ./...\n- actionlint .github/workflows/release.yml .github/workflows/ci.yml .github/workflows/tag-immutability.yml && git diff --check\n

Copilot AI review requested due to automatic review settings June 6, 2026 20:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the reliability of the embedded Playwright capture script by retrying page.goto when Chromium returns known transient network/navigation errors, while keeping CAPTCHA/interstitial failures fail-closed. It also adds a regression test to ensure the retry path exists in the script.

Changes:

  • Added transient-navigation error classification (isTransientNavigationError) and a bounded retry wrapper around page.goto (gotoWithTransientRetry).
  • Updated capture flow to use the retry wrapper for the initial navigation.
  • Added a regression test that asserts the retry logic is present in the embedded script.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
internal/provider/provider.go Adds transient navigation error detection and a 3-attempt retry around page.goto, then routes initial navigation through it.
internal/provider/provider_test.go Adds a regression test asserting the retry path exists in the embedded Playwright script (and aims to guard interstitial behavior).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/provider/provider.go
Comment thread internal/provider/provider_test.go Outdated
@intel352 intel352 merged commit e8362e1 into main Jun 6, 2026
3 checks passed
@intel352 intel352 deleted the fix/playwright-navigation-retry branch June 6, 2026 20:20
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.

2 participants