<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - REGRESSION: IndexedDB.IndexedDBMultiProcess and IndexedDB.WebProcessKillIDBCleanup are timing out"
   href="https://bugs.webkit.org/show_bug.cgi?id=165242#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - REGRESSION: IndexedDB.IndexedDBMultiProcess and IndexedDB.WebProcessKillIDBCleanup are timing out"
   href="https://bugs.webkit.org/show_bug.cgi?id=165242">bug 165242</a>
              from <span class="vcard"><a class="email" href="mailto:beidson&#64;apple.com" title="Brady Eidson &lt;beidson&#64;apple.com&gt;"> <span class="fn">Brady Eidson</span></a>
</span></b>
        <pre>The event handler in question is as follows:
        event.target.transaction.oncomplete = function() {
            window.webkit.messageHandlers.testHandler.postMessage('Transaction complete');
        }

~95% of the time, that message never gets back to native code.
Sometimes it does.

If I change it to the following:
        sawTransactionComplete = false;
        event.target.transaction.oncomplete = function() {
            window.webkit.messageHandlers.testHandler.postMessage('Transaction complete');
            sawTransactionComplete = true;
        }

... and then pass the value of sawTransactionComplete through to the onsuccess event handler message, native code sees that sawTransactionComplete is in fact true.

If I change it to the following:

        event.target.transaction.oncomplete = function() {
            window.webkit.messageHandlers.testHandler.postMessage('Transaction complete');
            alert(&quot;Made it here!&quot;);
        }

Then the existence of that alert() call makes the test reliably pass!</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>