<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>289259</bug_id>
          
          <creation_ts>2025-03-06 09:41:25 -0800</creation_ts>
          <short_desc>REGRESSION(291284@main) WebAutomationSession needs to push a command failure as soon as it gets it</short_desc>
          <delta_ts>2025-03-12 18:17:38 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebDriver</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>284470</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Lauro Moura">lmoura</reporter>
          <assigned_to name="Lauro Moura">lmoura</assigned_to>
          <cc>bburg</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2101020</commentid>
    <comment_count>0</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2025-03-06 09:41:25 -0800</bug_when>
    <thetext>291284@main changed WebAutomationSession callbacks to use a Function&lt;T&gt; 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-&gt;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&lt;String&gt; result) {
        if (!result) {
           ASSERT(!result.error().isEmpty());
           backendDispatcher-&gt;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&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2101025</commentid>
    <comment_count>1</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2025-03-06 09:51:27 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/42011</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2102722</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-03-12 16:56:04 -0700</bug_when>
    <thetext>&lt;rdar://problem/146900962&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2102737</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-03-12 18:17:36 -0700</bug_when>
    <thetext>Committed 292050@main (cc06097b2c44): &lt;https://commits.webkit.org/292050@main&gt;

Reviewed commits have been landed. Closing PR #42011 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>