Repository navigation
fix: do not retry withinFrame after its callback ran - #322
Merged
Merged
Conversation
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>
Member
|
thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
withinFrame()is wrapped byAwaitableWebpage::__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 thoughclick()on its own is excluded from the retry loop.This PR adds
withinFrameto$nonAwaitableMethods, next towithKeyDown, which has the same problem one level up (see #249). The frame lookup still waits through Playwright's ownwaitForandnetworkidle.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:
Webpagesuite 251 passed, 1 skipped (Linux).composer test:lintandcomposer test:typespass.🤖 Generated with Claude Code