RESOLVED FIXED 227815
Implement IDBTransaction.commit()
https://bugs.webkit.org/show_bug.cgi?id=227815
Summary Implement IDBTransaction.commit()
Chris Dumez
Reported 2021-07-08 14:19:46 PDT
Missing support for IDBTransaction.commit(): - https://www.w3.org/TR/IndexedDB/#dom-idbtransaction-commit Both Gecko and Blink support it so this is a compatibility risk. This is causing some WPT tests to fail in WebKit only.
Attachments
Patch (56.44 KB, patch)
2021-07-16 00:03 PDT, Sihui Liu
no flags
Patch (55.77 KB, patch)
2021-07-16 09:53 PDT, Sihui Liu
no flags
Patch (57.14 KB, patch)
2021-07-16 12:00 PDT, Sihui Liu
no flags
Patch (57.37 KB, patch)
2021-07-19 12:26 PDT, Sihui Liu
ews-feeder: commit-queue-
Patch (57.68 KB, patch)
2021-07-19 12:29 PDT, Sihui Liu
no flags
Chris Dumez
Comment 1 2021-07-08 14:20:49 PDT
If someone more knowledgeable with IDB could implement this, that'd be great. If no-one implements it, I'll probably look into it eventually but it will likely take me some time.
Radar WebKit Bug Importer
Comment 2 2021-07-15 14:20:25 PDT
Sihui Liu
Comment 3 2021-07-16 00:03:30 PDT
Sihui Liu
Comment 4 2021-07-16 09:53:00 PDT
Sihui Liu
Comment 5 2021-07-16 12:00:11 PDT
Chris Dumez
Comment 6 2021-07-19 09:30:36 PDT
Comment on attachment 433689 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433689&action=review > Source/WebCore/Modules/indexeddb/IDBRequest.cpp:299 > + m_dispatchingEvent = &event; We should rename the data member now that it is no longer a boolean, maybe m_eventBeingDispatched. > Source/WebCore/Modules/indexeddb/IDBTransaction.cpp:487 > + for (auto request : m_openRequests) { auto& to avoid ref counting churn. Could also be written as (if you prefer): auto pendingRequestCount = std::count_if(m_openRequests.begin(), m_openRequests.end(), [](auto& request) { return !request->isDone(); }); > Source/WebCore/Modules/indexeddb/IDBTransaction.cpp:492 > + scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, nullptr, [protectedThis = makeRef(*this), pendingRequestCount] (auto& operation) { makeRef() is deprecated. `protectedThis = Ref { *this }` is shorter with C++17. > LayoutTests/imported/w3c/ChangeLog:11 > + * web-platform-tests/IndexedDB/idb-explicit-commit.any-expected.txt: The change log should probably explain why the test is timing out and why we think that's OK.
Sihui Liu
Comment 7 2021-07-19 12:26:35 PDT
Sihui Liu
Comment 8 2021-07-19 12:29:17 PDT
Alex Christensen
Comment 9 2021-07-19 12:57:17 PDT
Comment on attachment 433811 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433811&action=review > LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any-expected.txt:13 > +TIMEOUT Transactions with same scope should stay in program order, even if one calls commit. Test timed out Is there a good explanation why this is happening, or do we know what it would take to fix it?
Chris Dumez
Comment 10 2021-07-19 12:58:26 PDT
Comment on attachment 433811 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433811&action=review > LayoutTests/imported/w3c/ChangeLog:11 > + * web-platform-tests/IndexedDB/idb-explicit-commit.any-expected.txt: Some test is timed out as our backend does Alex: I asked Sihui to add an explanation about this in the ChangeLog.
Sihui Liu
Comment 11 2021-07-19 13:49:53 PDT
Comment on attachment 433811 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433811&action=review >> LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any-expected.txt:13 >> +TIMEOUT Transactions with same scope should stay in program order, even if one calls commit. Test timed out > > Is there a good explanation why this is happening, or do we know what it would take to fix it? Yes, the test expects a later transaction to finish and fire events to end the first transactions. We don't support running multiple simultaneous transactions so the later transaction will be blocked. We would have passed the next two NOTRUN tests, but the test is timed out here.
Brady Eidson
Comment 12 2021-07-19 13:55:21 PDT
Comment on attachment 433811 [details] Patch Seems fine.
Brady Eidson
Comment 13 2021-07-19 13:55:42 PDT
(In reply to Brady Eidson from comment #12) > Comment on attachment 433811 [details] > Patch > > Seems fine. (With other previous feedback)
EWS
Comment 14 2021-07-19 16:09:58 PDT
Committed r280053 (239788@main): <https://commits.webkit.org/239788@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 433811 [details].
Note You need to log in before you can comment on or make changes to this bug.