W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

RE: Indexed database API autoIncrement

From: Israel Hilerio <israelh@microsoft.com>
Date: Mon, 24 Oct 2011 17:50:55 +0000
To: Futomi Hatano <info@html5.jp>
CC: "Jonas Sicking (jonas@sicking.cc)" <jonas@sicking.cc>, Kyle Huey <me@kylehuey.com>, "public-webapps@w3.org" <public-webapps@w3.org>, "Charles Pritchard" <chuck@jumis.com>
Message-ID: <F695AF7AA77CC745A271AD0F61BBC61E3F515D37@TK5EX14MBXC115.redmond.corp.microsoft.com>
On October 23, 2011 3:19 PM, Charles Pritchard wrote:
> On Oct 23, 2011, at 3:04 PM, Jonas Sicking <jonas@sicking.cc> wrote:
> 
> > On Sun, Oct 23, 2011 at 4:20 AM, Futomi Hatano <info@html5.jp> wrote:
> >> Hello everyone,
> >>
> >> I'm not a W3C member, can I send a mail to the list?
> >
> > Absolutely! This is a public list intended for just that!
> >
> >> I've tried to use Indexed database API using IE10 PP3 and Chrome 16 dev.
> >> I found a different behavior between the two.
> >> I set autoIncrement to true when I created a Object Store as below.
> >>
> >> var store = db.createObjectStore(store_name, { keyPath: 'id',
> >> autoIncrement: true });
> >>
> >> Then, I added some records.
> >>
> >> IE10 PP3 set the key value of the first recored to 0, while Chrome 16 set it
> to 1.
> >> Which is correct?
> >> I couldn't find the definition about this in the spec.
> >> The first value of autoIncrement should be defined in the spec, or
> >> the spec should allow us to set the first value of autoIncrement, I think.
> >>
> >> Sorry in advance if the discussion has already been done.
> >> Thank you for your time.
> >
> > Good catch! This definitely needs to be specified in the spec.
> >
> > I have a weak preference for using 1. This has a smaller risk of
> > triggering edge cases in the client code since it's always truthy.
> > I.e. if someone tries to detect the presence of an id, they won't fail
> > due to the id being 0.
> 
> I agree -- this is also the behavior in all DBMS I've worked with. There's time
> for MS to update their implementation. All around win.

We are aware of the issue and we're looking to fix the problem to be interoperable.  
Thanks for the feedback.

Israel
Received on Monday, 24 October 2011 18:01:15 GMT

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