Unhandled errors occur when "sendQuery" fails, such as "MessageHandlerFrame:MessageHandlerFrameParent:sendCommand: message reply cannot be cloned."
Categories
(Remote Protocol :: Agent, defect)
Tracking
(Not tracked)
People
(Reporter: whimboo, Unassigned)
References
Details
With the changes on bug 1937118 landed I can force an unhandled error of type MessageHandlerFrame:MessageHandlerFrameParent:sendCommand: message reply cannot be cloned.
when the called code in the child JSWindowActor returns data that cannot be cloned. In this case it's a Promise.
The change required to see the issue is:
diff --git a/remote/webdriver-bidi/modules/windowglobal/input.sys.mjs b/remote/webdriver-bidi/modules/windowglobal/input.sys.mjs
index 7d99ae7fe9cd9..831e608df7ea7 100644
--- a/remote/webdriver-bidi/modules/windowglobal/input.sys.mjs
+++ b/remote/webdriver-bidi/modules/windowglobal/input.sys.mjs
@@ -194,17 +194,17 @@ class InputModule extends WindowGlobalBiDiModule {
async _finalizeAction() {
// Terminate the current wheel transaction if there is one. Wheel
// transactions should not live longer than a single action chain.
ChromeUtils.endWheelTransaction();
// Wait for the next animation frame to make sure the page's content
// was updated.
- await lazy.AnimationFramePromise(this.messageHandler.window);
+ return lazy.AnimationFramePromise(this.messageHandler.window);
}
Then run test_click_navigation
from webdriver/tests/bidi/input/perform_actions/pointer_mouse.py
and you will see this test failure:
FAIL test_click_navigation - webdriver.bidi.error.UnknownErrorException: unknown error ([Exception... "MessageHandlerFrame:MessageHandlerFrameParent:sendCommand: message reply cannot be cloned." nsresult: "0x80004005 (DataCloneError)" location: "<unknown>" data: no])
Maybe it's a platform issue that is causing it? Otherwise maybe we have a chance to better handle it?
Comment 1•1 month ago
|
||
The severity field is not set for this bug.
:whimboo, could you have a look please?
For more information, please visit BugBot documentation.
Reporter | ||
Comment 2•22 days ago
|
||
There might be similar situations with other kinds of data where it would fail similarly. Lets check what exactly fails here, to determine if we need a generic fix.
Reporter | ||
Updated•15 days ago
|
Reporter | ||
Updated•15 days ago
|
Reporter | ||
Comment 3•14 days ago
|
||
It’s now clear why this issue occurs. In the case of AnimationFramePromise, we have a Promise.race involving an animation frame and an EventPromise for the pagehide event. In this scenario, the EventPromise resolves first, returning the event object as its value. Since the event object contains a reference to the event's target, which is not serializable, the error makes sense.
Since _finalizeAction does not need to return a value, we can simply await the promise's resolution without including a return statement.
While this issue could theoretically occur in other cases, I haven’t encountered any so far beyond this instance. Therefore, we can resolve this bug and move forward.
Description
•