Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 63d8b60a92ac82753140d330c1b12718c7a866ef
      
https://github.com/WebKit/WebKit/commit/63d8b60a92ac82753140d330c1b12718c7a866ef
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-10-07 (Wed, 07 Oct 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    A LayoutTests/http/tests/IndexedDB/resources/abort-then-stop-frame.html
    A 
LayoutTests/http/tests/IndexedDB/transaction-abort-pending-requests-stop-expected.txt
    A 
LayoutTests/http/tests/IndexedDB/transaction-abort-pending-requests-stop.html
    M Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
    M Source/WebCore/Modules/indexeddb/IDBTransaction.cpp

  Log Message:
  -----------
  REGRESSION(321564@main): IDBDatabase::stop() force-closing the server 
connection can leak a committing or aborting transaction
https://bugs.webkit.org/show_bug.cgi?id=325521
rdar://188609926

Reviewed by Sihui Liu.

321564@main made IDBDatabase::stop() close the connection in the server
unconditionally. In a document, that can leave a still-committing or
still-aborting transaction stranded, because didCommit or didAbort never
arrives:

- The commit is held on the client until didStart. When the connection is
  closed first, the server deletes the pending transaction, so the commit
  is never sent and no didStart or didCommit is delivered.
- The commit reaches the server after the close. IDBServer::commitTransaction()
  then finds no transaction and drops the commit silently.

Since virtualHasPendingActivity() is true for any non-Finished state, the
transaction and its requests then never get collected.

This only affects documents. In workers, abortActivitiesForCurrentThread()
already finalizes these transactions. Before 321564@main, a document still
received didCommit or didAbort, because callbacks on the main thread are
delivered directly.

Finalize committing and aborting transactions locally via
connectionClosedFromServer() when force-closing, matching 
connectionToServerLost().
forgetTransaction() prevents a later stale didCommit or didAbort from reaching 
the
finished transaction. connectionClosedFromServer() now skips 
willAbortTransaction()
for a transaction that is already aborting, since it is no longer in the active 
or
committing map.

Test: http/tests/IndexedDB/transaction-abort-pending-requests-stop.html

* LayoutTests/TestExpectations: Remove flaky expectation.
* LayoutTests/http/tests/IndexedDB/resources/abort-then-stop-frame.html: Added.
* 
LayoutTests/http/tests/IndexedDB/transaction-abort-pending-requests-stop-expected.txt:
 Added.
* 
LayoutTests/http/tests/IndexedDB/transaction-abort-pending-requests-stop.html: 
Added.
* Source/WebCore/Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::stop):
* Source/WebCore/Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::connectionClosedFromServer):

Canonical link: https://commits.webkit.org/323066@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to