Skip to content

fix: do not retry withinFrame after its callback ran - #322

Merged
MrPunyapal merged 2 commits into
pestphp:5.xfrom
likemusic:fix/within-frame-not-retried
Nov 18, 2026
Merged

MrPunyapal merged 2 commits into
pestphp:5.xfrom
likemusic:fix/within-frame-not-retried

Conversation

@likemusic

Copy link
Copy Markdown
Contributor

withinFrame() is wrapped by AwaitableWebpage::__call, so an attempt that fails (or times out) runs the whole callback again. If the callback has already clicked inside the frame, the click is repeated, even though click() on its own is excluded from the retry loop.

This PR adds withinFrame to $nonAwaitableMethods, next to withKeyDown, which has the same problem one level up (see #249). The frame lookup still waits through Playwright's own waitFor and networkidle.

The regression test clicks a button inside the frame and then fails the callback. Without this change the click fires twice on 5.x; with it the callback runs once and the failure reaches the test.

Tests: Webpage suite 251 passed, 1 skipped (Linux). composer test:lint and composer test:types pass.

🤖 Generated with Claude Code

likemusic and others added 2 commits November 16, 2026 23:28
withinFrame() is wrapped by the retry loop, so when an attempt fails
after the callback has already clicked inside the frame, the whole
callback runs again and the click is repeated. Exclude withinFrame from
the loop, the same way withKeyDown is excluded.

Add a regression test: the callback clicks a button in the frame and
then fails, and the click must happen once and the failure must reach
the test.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@MrPunyapal
MrPunyapal merged commit 0662d65 into pestphp:5.x Nov 18, 2026
2 checks passed
@MrPunyapal

Copy link
Copy Markdown
Member

thanks

@likemusic
likemusic deleted the fix/within-frame-not-retried branch November 18, 2026 20:10
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