W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2012

Re: [IndexedDB] blocked event could be an error

From: Odin Hørthe Omdal <odinho@opera.com>
Date: Wed, 15 Aug 2012 19:32:30 +0200
To: public-webapps@w3.org
Message-ID: <op.wi3e0g0w49xobu@odinho-fido.oslo.osa>
On Fri, 27 Jul 2012 00:31:08 +0200, Jonas Sicking <jonas@sicking.cc> wrote:

> On Thu, Jul 26, 2012 at 3:28 PM, João Eiras <joaoe@opera.com> wrote:
>>
>>> I definitely think that we need to keep the "blocked" events as
>>> non-error events since it supports the use case of opening a
>>> connection and displaying UI to the user asking that other tabs are
>>> closed if the "blocked" event fires.
>>
>> That can very well be achieved by detecting the BlockedError, and  
>> adding a retry button which calls open() again.
>>
>> If you really want a open() and wait forever behavior, that should not  
>> be the default one.
>
> I'm not at all comfortable with changing the default behavior this
> late in the process.

I really think we should change it. The behaviour we have now is very very  
surprising and I don't think very sane.

If the IE implementation that's available now really is the one they're  
shipping (I seem to remember they said something like that), it'll be  
divergent in those parts already.

The alternatives are not that good, they are papering over a problem so  
that careful developers can do the right thing, but they will probably  
also write  db.onversionchange = function() { db.close() }  correctly. The  
careless developers (of which inhabit many parts of the intertubes) will  
not, and then you'd just get all those waiting requests hanging around.


If someone wants to tell me to close my other window, it's very easy to  
check the error on the open request for BlockedError. Of course, if you  
want it to be automatic, you'd have to try a new open with some interval,  
but that shouldn't be a big problem.


I would go out on a limb and say that I think this part of IndexedDB is  
probably not very much used at this point. And if there are any users,  
they're hopefully already sufficently advanced to already have written a  
db-close in versionchange so that they won't be relying on the blocked  
system.


Well, it's a lot of hope, but I don't think this is something we should be  
stuck with.
-- 
Odin Hørthe Omdal (Velmont/odinho) · Core, Opera Software, http://opera.com
Received on Wednesday, 15 August 2012 17:33:03 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:54 GMT