You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems like a safe, web-compatible change; the queued microtask would run after any microtasks enqueued by event handlers, so the microtask for the Promise returned by getvalue in @jakearchibald's example would run before the "unset 'active'" microtask.
I don't see why @jakearchibald's example would fail in a compliant Promise implementation.
The 'active' flag gets set to false once the success handler for the "getValue" returns. But the Promise implementation should run then-callbacks at the end of the microtask, which is before the event handler returns, no?
Ported from https://www.w3.org/Bugs/Public/show_bug.cgi?id=29049 by @jakearchibald
When a transaction is created, 'active' is unset when control is returned to the event loop http://w3c.github.io/IndexedDB/#dom-idbdatabase-transaction (8).
When onsuccess is fired, 'active' is unset once the event has dispatched http://w3c.github.io/IndexedDB/#fire-a-success-event (4).
If both of these were "queue a microtask to unset 'active'", it would be more consistent and allow promise-based APIs to interact with IDB.
Currently, building an abstraction like this is impossible:
Assuming
getValue
returns a compliant promise,setValue
fails as the transaction is inactive.The text was updated successfully, but these errors were encountered: