<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>18502</bug_id>
          
          <creation_ts>2012-08-08 16:18:19 +0000</creation_ts>
          <short_desc>[IndexedDB] Editorial: Wording around IDBFactory.open() with no version misleading</short_desc>
          <delta_ts>2013-03-01 19:48:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>Indexed Database API</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joshua Bell">jsbell</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71940</commentid>
    <comment_count>0</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-08-08 16:18:19 +0000</bug_when>
    <thetext>The second paragraph reads:

&quot;If no version is specified and a database exists, use the current database version and follow the steps for opening a database. If no version is specified and no database exists, set database version to 1, follow the steps for opening a database, and return a database without object stores.&quot;

The most glaring issue is the final phrase, &quot;return a database without object stores&quot; - the function returns an IDBRequest, not a database.  The intent is also redundant with step 4 of the &quot;Steps for opening a database&quot;.

The phrase &quot;set database version to 1&quot; may also be misleading. More correctly it should follow the phrasing used in the first paragraph which define the inputs to the steps, e.g. &quot;If no version is specified and no database exists, let /origin/ be the origin of the IDBEnvironment used to access this IDBFactory, let /name/ be the name parameter passed to this function, and let /version/ be 1.&quot;

(There also seems to be some ambiguity about what happens if open() is called without a version but is delayed by a deleteDatabase(); the delete should happen first, but does the open() use the version the database had prior to the delete? If so, that&apos;s a little odd. If not, then the version can&apos;t logically be determined at this point in the spec, and must be deferred to the &quot;Steps for opening&quot; e.g. by having the /version/ be null with special cases. I may just be missing something in the spec, though.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83359</commentid>
    <comment_count>1</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-02-19 23:52:45 +0000</bug_when>
    <thetext>Here&apos;s how I think this needs to be fixed:

In both 3.2.3 IDBFactory.open and 3.3.1 IDBFactorySync.open, add this to the end of the first paragraph:

&quot;If no /version/ argument was passed to this function, let /version/ be |undefined|.&quot;

And delete the second paragraph, &quot;If no version.... without object stores.&quot;

Then in 4.1 Opening a database, insert a new step between steps 4 and 5:

X. If /version/ is |undefined|, then let /version/ be 1 if /db/ was created in the previous step, or the current _version_ of /db/ otherwise.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83882</commentid>
    <comment_count>2</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-03-01 19:48:04 +0000</bug_when>
    <thetext>Fixed in https://dvcs.w3.org/hg/IndexedDB/rev/3662e5052bc0

Since I filed this, I&apos;d appreciate another set of eyeballs to verify the change.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>