[Webkit-unassigned] [Bug 222746] New: IDBTransaction is closed prematurely if a microtask is awaited after opening the transaction under some circumstances

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 4 09:49:27 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=222746

            Bug ID: 222746
           Summary: IDBTransaction is closed prematurely if a microtask is
                    awaited after opening the transaction under some
                    circumstances
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Mac (Intel)
                OS: macOS 10.15
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore JavaScript
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: brunow at element.io

Created attachment 422245

  --> https://bugs.webkit.org/attachment.cgi?id=422245&action=review

a small test case reproducing the problem

I'm encountering an issue with IndexedDB which I can reproduce on several webkit based browsers (Safari on iOS 13.4, Safari TP 121 on macOS 10.15, and WebKitGTK 2.30.5 on Linux).
The issue is that under some circumstances, an IDBTransaction can get closed if you wait a single microtask (e.g. await Promise.resolve()) to queue your first IDBRequest (as opposed to a macrotask, which is expected).

In the web app where I encountered the issue, it happens easily if I have optional async code path after opening a transaction (async because they use indexeddb, no other macro tasks).

I've attached a test case that reproduces the problem, where scheduling a macro task in between two transactions seems to trigger the bug.
I have reduced it as much as possible, so every step is essential to reproduce the problem AFAIK.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210304/99fcf9c5/attachment.htm>


More information about the webkit-unassigned mailing list