Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4acb9114542c1ffdf4cca6d9b9390c2ce64c6768
      
https://github.com/WebKit/WebKit/commit/4acb9114542c1ffdf4cca6d9b9390c2ce64c6768
  Author: Sihui Liu <[email protected]>
  Date:   2025-10-20 (Mon, 20 Oct 2025)

  Changed paths:
    M Source/WebCore/Modules/indexeddb/server/ServerOpenDBRequest.cpp
    M Source/WebCore/Modules/indexeddb/server/ServerOpenDBRequest.h
    M Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp
    M Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp
    M Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h

  Log Message:
  -----------
  Fix UniqueIDBDatabaseTransaction error: finished request count is bigger than 
total request count
https://bugs.webkit.org/show_bug.cgi?id=301027
rdar://162913897

Reviewed by Chris Dumez and Per Arne Vollan.

When running basic IndexedDB tests like storage/indexeddb/basics.html, there is 
error log about "finished request count
bigger than total requested" (printed from 
UniqueIDBDatabaseTransaction::shouldAbortDueToUnhandledRequestError). This
error means at the time a transaction is committed, the number of requests 
handled by IndexedDB server for the
transaction ("total requested") is smaller than the number of request results 
processed by client ("finished request
count"). This cannot happen in normal case because client receives request 
results from server. The error could lead to
shouldAbortDueToUnhandledRequestError always returns false, without checking 
the errors in existing results.

The cause of the issue is that client counts result of open request for version 
change transaction, but server does not.
Normally, request will be submitted to UniqueIDBDatabaseTransaction, and it 
will update m_requestResults (the size of
m_requestResults is "total requested") after result is available. However, for 
open requests, they are handled by
UniqueIDBDabase directly and the result is dispatched via ServerOpenDBRequest 
(so the transaction does not know about
the result). To fix this issue, this patch makes ServerOpenDBRequest keep track 
of its versions change transaction and
update the transaction about the open request result. (Note delete database 
request is not associated with a
transaction, so we don't need to update result for didDeleteDatabase). With 
this fix, running the test no longer prints
the error log.

* Source/WebCore/Modules/indexeddb/server/ServerOpenDBRequest.cpp:
(WebCore::IDBServer::ServerOpenDBRequest::setVersionChangeTransaction):
(WebCore::IDBServer::ServerOpenDBRequest::didDeleteDatabase):
(WebCore::IDBServer::ServerOpenDBRequest::didOpenDatabase):
(WebCore::IDBServer::ServerOpenDBRequest::notifyDidDeleteDatabase): Deleted.
* Source/WebCore/Modules/indexeddb/server/ServerOpenDBRequest.h:
* Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperationAfterSpaceCheck):
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
(WebCore::IDBServer::errorOpenDBRequestForUserDelete):
* Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::addOpenRequestResult):
* Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to