<?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>29049</bug_id>
          
          <creation_ts>2015-08-10 08:52:50 +0000</creation_ts>
          <short_desc>Queue a microtask to unset active on transaction</short_desc>
          <delta_ts>2015-08-10 16:57:50 +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>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</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="Jake Archibald">jaffathecake</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>annevk</cc>
    
    <cc>jsbell</cc>
    
    <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>122532</commentid>
    <comment_count>0</comment_count>
    <who name="Jake Archibald">jaffathecake</who>
    <bug_when>2015-08-10 08:52:50 +0000</bug_when>
    <thetext>When a transaction is created, &apos;active&apos; is unset when control is returned to the event loop http://w3c.github.io/IndexedDB/#dom-idbdatabase-transaction (8).

When onsuccess is fired, &apos;active&apos; is unset once the event has dispatched http://w3c.github.io/IndexedDB/#fire-a-success-event (4).

If both of these were &quot;queue a microtask to unset &apos;active&apos;&quot;, it would be more consistent and allow promise-based APIs to interact with IDB.

Currently, building an abstraction like this is impossible:

beginTransaction();
getValue(&apos;foo&apos;).then(function(val) {
  console.log(val);
  return setValue(val)
});

Assuming `getValue` returns a compliant promise, `setValue` fails as the transaction is inactive.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122539</commentid>
    <comment_count>1</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2015-08-10 16:57:50 +0000</bug_when>
    <thetext>Moved to https://github.com/w3c/IndexedDB/issues/27</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>