Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timing issue where a disconnected node is being requested & returned #362

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

stevschmid
Copy link

This PR fixes the issue outlined in rubycdp/cuprite#239.

I fixed this initially by adding a node.isConnected check to Cuprite.isVisible, but after digging a bit deeper, it seems that the node get disconnected between the call for _cuprite.find and its handle_response. In this case we request a node via DOM.requestNode which is not connected to the document anymore and does not seem to get obsolete (subsequent commands such as #visible? never raise NodeNotFoundError).

I'm not sure this is the right place, maybe adding a disconnected check in Cuprite Node might be a bit less invasive. Please tell me what you think.

Previous solution had still some leeway for timing issues, leading to
intermittent failing specs (albeit rarely)
@espen
Copy link

espen commented Nov 10, 2023

I am facing a similar issue in my tests. It will occasionally fail. However never when I do a puts page.body before interacting with the node.

While I only did very minimal testing I was not able to reproduce this bug with this patch.

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