Re: Indexed DB: Opening connections, versions, and priority

On Wed, Feb 26, 2014 at 10:35 AM, Joshua Bell <jsbell@google.com> wrote:
> While looking at a Chrome bug [1], I reviewed the Indexed DB draft, section
> 3.3.1 [2] Opening a database:
>
> "These steps are not run for any other connections with the same origin and
> name but with a higher version"
>
> And the note: "This means that if two databases with the same name and
> origin, but with different versions, are being opened at the same time, the
> one with the highest version will attempt to be opened first. If it is able
> to successfully open, then the one with the lower version will receive an
> error."
>
> I interpret that as (and perhaps the spec should be updated to read): "This
> means that if two open requests are made to the database with the same name
> and origin at the same time, the open request with the highest version will
> be processed first. If it is able to successfully open, then the request
> with the lower version will receive an error."
>
> So far as I can tell with a test [3], none of Chrome (33), Firefox (27), or
> IE (10) implement this per spec. Instead of processing the request with the
> highest version first, they process the first request that was received.
>
> Is my interpretation of the spec correct?

Yes

> Is my test [3] correct?

Well...

> If yes and yes, should we update the spec to match reality?

Short answer: Yes, I think we can remove the current text from the spec

Long answer: It depends on how one defines "same time". Your testcase
doesn't open make the open calls at the "same time" but rather one
after another. Though it's a clever trick to stall them all using a
delete operation.

But ultimately I think the definition of "same time" is ambiguous
enough that the current spec language doesn't add any value. So your
proposed change seem like an improvement.

/ Jonas

> [1] https://code.google.com/p/chromium/issues/detail?id=225850
> [2] https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#opening
> [3] http://jsfiddle.net/Nbg2K/2/
>

Received on Friday, 28 February 2014 06:57:20 UTC