Skip to content

Handle routed Playwright route.fetch context disposal without crashing recipe runs #928

@chubes4

Description

@chubes4

Problem

While running the WPCOM selected-page editor proof, a routed browser request crashed the recipe run with:

route.fetch: Request context disposed.

Observed request context:

  • Request: POST /wp-admin/admin-ajax.php
  • Referer: routed WPCOM editor URL
  • Scenario: browser/editor proof with routed wordpress.com host traffic

This appears to be a Playwright/request-lifecycle race. A disposed request context during routed fetch should not crash the whole recipe when the page/browser is already tearing down or navigating.

Local patch direction

A local branch has a targeted patch in:

packages/runtime-playground/src/browser-preview-routing.ts

The patch treats only Request context disposed route-fetch failures as non-fatal routed-request cancellation. Other routed fetch failures still surface normally.

Acceptance criteria

  • Add coverage for the disposed-context route fetch case.
  • The recipe run does not fail solely because a routed request context was disposed during teardown/navigation.
  • Other routing errors remain visible and fail as appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions