Bug 289259
| Summary: | REGRESSION(291284@main) WebAutomationSession needs to push a command failure as soon as it gets it | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Lauro Moura <lmoura> |
| Component: | WebDriver | Assignee: | Lauro Moura <lmoura> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bburg, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 284470 | ||
| Bug Blocks: | |||
Lauro Moura
291284@main changed WebAutomationSession callbacks to use a Function<T> approach instead of CallbackBase. In the generated code for the dispatchers, currently we get the following for evaluteJavaScriptFunction, which is used by a number of commands like getElementText:
m_agent->evaluateJavaScriptFunction(in_browsingContextHandle, in_opt_frameHandle, in_function, in_arguments.releaseNonNull(), WTFMove(in_opt_expectsImplicitCallbackArgument), WTFMove(in_opt_forceUserGesture), WTFMove(in_opt_callbackTimeout), [backendDispatcher = m_backendDispatcher.copyRef(), protocol_requestId](CommandResult<String> result) {
if (!result) {
ASSERT(!result.error().isEmpty());
backendDispatcher->reportProtocolError(protocol_requestId, BackendDispatcher::ServerError, result.error());
return;
}
The problem is that `reportProtocolError` just stores the errors to send them later. This might cause clients to hang, given WebDriver Classic's synchronous approach, or even crash, if we have pending errors and the client (the driver) tries to send another command to be dispatched before flushing the errors.
Tentative patch incoming.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Lauro Moura
Pull request: https://github.com/WebKit/WebKit/pull/42011
Radar WebKit Bug Importer
<rdar://problem/146900962>
EWS
Committed 292050@main (cc06097b2c44): <https://commits.webkit.org/292050@main>
Reviewed commits have been landed. Closing PR #42011 and removing active labels.