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
It does seem like most of the algorithms currently expect to be run "in parallel" and https://w3c.github.io/IndexedDB/#close-a-database-connection explicitly is mixing things that must be done synchronously on the agent thread with things that must happen in parallel (but sequentially for the db/all its connections) so it could make sense to:
Change close()'s algorithm to be:
If connection's close pending flag is set, return.
Activity
SteveBeckerMSFT commentedon Sep 22, 2025
The existing spec looks like it matches Chromium's implementation. Since IDBDatabase::transaction() is also synchronous, we need to set the connection's close pending flag synchronously since it is also checked by transaction().
Maybe we could improve step 3 when the forced flag is set to false?
This is not a synchronous wait, but the close may happen in the same thread. Maybe there's a better way to express this?
asutherland commentedon Sep 22, 2025
It does seem like most of the algorithms currently expect to be run "in parallel" and https://w3c.github.io/IndexedDB/#close-a-database-connection explicitly is mixing things that must be done synchronously on the agent thread with things that must happen in parallel (but sequentially for the db/all its connections) so it could make sense to:
Change close()'s algorithm to be:
We'd then update https://w3c.github.io/IndexedDB/#close-a-database-connection to also handle the need to queue a task since you can't dispatch an event from the "in parallel" conceptual thread, so that text would become:
And I think that's compatible with the existing https://w3c.github.io/IndexedDB/#close-a-database-connection use of https://w3c.github.io/IndexedDB/#close-a-database-connection.