Performing actions can fail with async events enabled, throwing "JavascriptException: Cyclic object value"
Categories
(Remote Protocol :: Marionette, defect, P2)
Tracking
(firefox-esr115 unaffected, firefox-esr128 unaffected, firefox135 wontfix, firefox136 wontfix, firefox137 fixed)
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox-esr128 | --- | unaffected |
firefox135 | --- | wontfix |
firefox136 | --- | wontfix |
firefox137 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
(Blocks 1 open bug, Regression, )
Details
(Keywords: regression, Whiteboard: [webdriver:m15])
Attachments
(3 files)
Originally filed as: https://github.com/mozilla/geckodriver/issues/2212
It's reproducible with the following Marionette test:
def test(self):
self.marionette.navigate(
"https://support.zoom.com/login_locate_sso.do")
elem = self.marionette.find_element(By.ID, "sso_selector_id")
mouse_chain = self.marionette.actions.sequence("pointer", "pointer_id")
mouse_chain \
.pointer_move(10, 1, origin=elem)
mouse_chain.perform()
The error in detail is:
ERROR _a/test_minimized.py TestMinimizedTestCase.test - marionette_driver.errors.JavascriptException: Cyclic object value
stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:197:5
JavaScriptError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:476:5
cloneObject@chrome://remote/content/marionette/json.sys.mjs:46:11
cloneJSON@chrome://remote/content/marionette/json.sys.mjs:207:12
cloneObject@chrome://remote/content/marionette/json.sys.mjs:59:24
cloneJSON@chrome://remote/content/marionette/json.sys.mjs:207:12
cloneObject@chrome://remote/content/marionette/json.sys.mjs:59:24
cloneJSON@chrome://remote/content/marionette/json.sys.mjs:207:12
cloneObject@chrome://remote/content/marionette/json.sys.mjs:59:24
cloneJSON@chrome://remote/content/marionette/json.sys.mjs:207:12
json.clone@chrome://remote/content/marionette/json.sys.mjs:212:22
receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.sys.mjs:306:19
Sadly the cycle error doesn't give more details about which object is causing the issue. When I print more details then I see:
function argumentNames(){var names=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return names.length==1&&!names[0]?[]:names}
It happens when we are calling executeScript
in the content process to get the element.getClientRect()
. This looks like some custom method added to the DOMRect object? I need to check in more detail.
Assignee | ||
Updated•13 days ago
|
Assignee | ||
Updated•13 days ago
|
Updated•13 days ago
|
Assignee | ||
Comment 1•13 days ago
|
||
Hi Donal, mind explaining why it is a wontfix for 136? As I can see we have still some weeks left for beta and an uplift should always be possible once we got it fixed. Thanks.
Comment 2•13 days ago
|
||
Hi Henrik, it's not a new issue in Fx136, without a patch, and triaged as an S3.
I've changed it to fix optional if there's a low risk patch before we are done with beta
Assignee | ||
Comment 3•12 days ago
|
||
The problem here is related to the Prototype Javascript framework the Zoom login page is making use of. It extends various elements on the page with so called extensions:
var extensions = {
argumentNames: argumentNames,
bindAsEventListener: bindAsEventListener,
curry: curry,
delay: delay,
defer: defer,
wrap: wrap,
methodize: methodize
};
Those are applied to the Function prototype, but as well seem to wrap existing methods of the parent class. I tried to minimize the page and got as far as the attached testcase.html shows.
Why it's related to Perform Actions
? It's happening because when we are trying to get the element rects to determine if the element is within the visible viewport we currently make use of script evaluation. This actually adds further complexity and has as well the side-effect that we are trying to serialize values including the modified Function prototype with the cyclic reference.
To prevent that it would be better to do it similarly like we already do in WebDriver BiDi and use a dedicated _getClientRects
method in the Marionette commands child actor to only return the client rects array. We even already have this method but it's not used. Somehow I left in the call to executeScript.
Assignee | ||
Updated•12 days ago
|
Assignee | ||
Comment 4•12 days ago
|
||
Assignee | ||
Comment 5•12 days ago
|
||
Comment 7•10 days ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5f1ad118e753
https://hg.mozilla.org/mozilla-central/rev/b8ad667542c1
Comment 8•9 days ago
|
||
The patch landed in nightly and beta is affected.
:whimboo, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox136
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Comment 9•9 days ago
|
||
There are merge conflicts for beta and given that this is most likely a rare situation and a workaround exists, let it ride the trains.
Description
•