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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>86127</bug_id>
          
          <creation_ts>2012-05-10 12:29:13 -0700</creation_ts>
          <short_desc>IndexedDB: IDBDatabase properties not snapshotted on connection close</short_desc>
          <delta_ts>2012-06-22 15:23:32 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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>
          <dependson>88467</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joshua Bell">jsbell</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>620856</commentid>
    <comment_count>0</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-05-10 12:29:13 -0700</bug_when>
    <thetext>The spec sayeth:

http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBDatabase

IDBDatabase.objectStoreNames: &quot;Once the closePending flag is set on the connection, this function must return a snapshot of the list of names of the object stores taken at the time when the close method was called.&quot; ... &quot;Even if another connection is later used to modify the version, that attribute on closed instances are not changed.&quot;

IDBDatabase.version; &quot;On getting, this attribute must return the version of the database when this IDBDatabase instance was created. When a IDBDatabase instance is created, this is always the number passed as the version argument passed to the open call used to create the IDBDatabase instance. This value remains constant for the lifetime of the IDBDatabase object. If the connection is closed, this attribute represents a snapshot of the version that the database had when the connection was closed. Even if another connection is later used to modify the version, that attribute on closed instances are not changed.&quot;

WebKit currently always queries the back end, even for closed connections. For example, running the attached script yields:

open - expecting 1: 1
open - expecting 1: 1
open - expecting 2: 2
open - expecting 2: 2
closed - expecting 1: 2
closed - expecting 1: 2
closed - expecting 2: 2
closed - expecting 2: 2

Note the &quot;closed - expecting 1: 2&quot; lines that show the value was not snapshotted</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>620859</commentid>
    <comment_count>1</comment_count>
      <attachid>141225</attachid>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-05-10 12:29:35 -0700</bug_when>
    <thetext>Created attachment 141225
Repro case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>632161</commentid>
    <comment_count>2</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-05-23 16:18:44 -0700</bug_when>
    <thetext>Implementing http://crbug.com/129470 would make this relatively easy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>655831</commentid>
    <comment_count>3</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-06-22 15:23:32 -0700</bug_when>
    <thetext>Fixed by http://trac.webkit.org/changeset/121059</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>141225</attachid>
            <date>2012-05-10 12:29:35 -0700</date>
            <delta_ts>2012-05-10 12:29:35 -0700</delta_ts>
            <desc>Repro case</desc>
            <filename>nosnap.html</filename>
            <type>text/html</type>
            <size>1394</size>
            <attacher name="Joshua Bell">jsbell</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxzY3JpcHQ+CnZhciBkYmgxLCBkYmgyOwoKd2Via2l0SW5kZXhlZERC
LmRlbGV0ZURhdGFiYXNlKCJub3NuYXAiKS5vbnN1Y2Nlc3MgPSBmd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