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

core: Handle DOM.resolveNode errors #5427

Merged
merged 5 commits into from
Jun 5, 2018
Merged

core: Handle DOM.resolveNode errors #5427

merged 5 commits into from
Jun 5, 2018

Conversation

webcarrot
Copy link
Contributor

Summary
Catch DOM.resolveNode errors.

Related Issues/PRs
Issue: #2736

Prevent:
```
Audit error: Required EventListeners gatherer encountered an error: Protocol error (DOM.resolveNode): No node with given id found
```
issue: #2736
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@webcarrot webcarrot changed the title Fix dom.resolve node core: Handle DOM.resolveNode errors Jun 5, 2018
@googlebot
Copy link

CLAs look good, thanks!

@webcarrot
Copy link
Contributor Author

@paulirish
It works for me but I'm not sure if it should not be handled elsewhere - I do not know this project and flows in it.

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @webcarrot this is a great start!

@patrickhulce patrickhulce merged commit 8f23052 into GoogleChrome:master Jun 5, 2018
@@ -63,7 +63,8 @@ class Element {
return null;
}
return this.driver.getObjectProperty(resp.object.objectId, propName);
});
})
.catch(() => null);
Copy link
Member

@brendankenny brendankenny Jun 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I'm not sure we should fail silently here because the semantics end up being a bit weird (pretending the property doesn't exist when it's actually the element that doesn't). It seems like the caller should handle the exception (like it now does above in all-event-listeners).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is consistent with the current behavior of the method though, returning null when the object does not exist. If we keep throwing here, we should convert the above to throw and change the typedef

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good point, I missed the first check. I wonder if we ever actually fail here then. The issue seems like it's been the event listener gatherer that's been failing. All good regardless.

@webcarrot webcarrot deleted the fix-DOM.resolveNode branch June 8, 2018 12:54
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.

5 participants