-
Notifications
You must be signed in to change notification settings - Fork 66
Specify IDBOpenDBRequest processing as a queue? #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In v1 of the spec the language for deleteDatabase is "The method then queues up an operation to run the steps for deleting a database" In both cases the "steps for deleting a database" are queued and run asynchronously. In neither case is the "delete pending flag" set immediately. So the example code actually does the following: indexedDB.open - "The method then queues up an operation to run the steps for opening a database." There's no mention of setting the "delete pending flag" anytime before the steps for deleting a database are executed. Trunk WebKit and Firefox treat these as a queue as mentioned above, and I think they're right. |
Ah, yes. Are the queues in your implementations specific to the database - (origin, name) pair? |
For WebKit, the queues are specific to the unique database. I don't know about Firefox. |
Cool. I'll work on improving the spec text and get some web-platform-tests together. |
Note to self: the V2 spec should not use the "queue a task" phrase here since that's specific to event loops. These queues span execution contexts. |
I'm pretty sure it should still say that it should "queue a task" somewhere, otherwise how does the actual opening of the connection interact with the event queue from the caller? |
Also: * Remove 'delete pending' flag which is not longer needed. * Simplify some section names. * Move the versionchange/blocked logic from upgrade steps to open steps, for symmetry with delete steps. * Rename 'Authorization' section to 'Security Concerns'
Should be resolved by d1147cb - take a peek? |
AFAICT this is not good enough, because that means an IDBOpenDBRequest's result can be set before event handlers were even set on it, given now the setting etc occur in parallel. |
Thanks @nox - take another look? I'd also forgotten to update the |
Consider:
IIRC we discussed this before. Chrome is following the letter of the spec, that in "steps for deleting a database" the "delete pending flag" is set immediately (no waiting) and in "steps for opening a database" the steps wait on the "delete pending flag". Firefox instead processes IDBOpenDBRequests (opens, deletes) on a named database as a FIFO queue.
This is an observable incompatibility, so we should probably standardize the behavior one way or the other.
The text was updated successfully, but these errors were encountered: