Skip to content

fix: skip errors that answer another request in Client::execute() - #309

Closed
likemusic wants to merge 2 commits into
pestphp:5.xfrom
likemusic:fix/skip-foreign-error-response
Closed

likemusic wants to merge 2 commits into
pestphp:5.xfrom
likemusic:fix/skip-foreign-error-response

Conversation

@likemusic

Copy link
Copy Markdown
Contributor

Errors are thrown before the id check, so a late error for an abandoned request ends the next command. The loop already skips ordinary responses with another id; this applies the same rule to error responses.

Adds tests/Unit/Playwright/ClientForeignErrorTest.php:

  • before: fails with "Navigation aborted"
  • after: passes; tests/Unit/Playwright: 15 passed

Related: #247 (stale response ids), #266 (matching navigation response).

Downstream this shows up as flaky "interrupted by another navigation" failures.

🤖 Generated with Claude Code

likemusic and others added 2 commits November 13, 2026 02:48
The error check ran before the request-id check, so an error for an
abandoned earlier request was thrown into the next command.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
PHPStan (isset.offset, level max) reports the error key as always present
in the docblock shape, so the isset() guard for foreign responses fails
the test:types step in the fork's CI.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@likemusic

Copy link
Copy Markdown
Contributor Author

Closing as superseded: since #247 (merged), Client::execute() skips every frame whose id belongs to another request, which covers the foreign error response this PR skipped. ClientForeignErrorTest from this PR passes on current 5.x (0662d65) without the change here.

@likemusic likemusic closed this Nov 18, 2026
@likemusic
likemusic deleted the fix/skip-foreign-error-response branch November 18, 2026 17:30
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