[w3c/IndexedDB] The done flag is never unset between upgradeneeded and success (#161)

There's a note in the [request definition](https://w3c.github.io/IndexedDB/#request-construct):

> Requests are not typically re-used, but there are exceptions. When a cursor is iterated, the success of the iteration is reported on the same request object used to open the cursor. And when an upgrade transaction is necessary, the same open request is used for both the upgradeneeded event and final result of the open operation itself. In both cases, the request’s done flag will be unset then set again, and the result may change.

For cursor iteration there are explicit _"Unset the done flag on request."_ steps (e.g. in [continue()](https://w3c.github.io/IndexedDB/#dom-idbcursor-continue)). But there's nothing in the [steps for upgrade transactions](https://w3c.github.io/IndexedDB/#upgrade-transaction-steps).

I'd expect a final step there that unsets the done flag. Ostensibly this would be visible as a change in the request's `readyState` between the "complete" event fired at the transaction and the "success" event fired at the request. 

However... I'm unable to test this in either Chrome or Firefox. In Chrome, at least, the code that queues the "complete" and "success" doesn't really leave room for anything to happen in between, at least not in a non-racy way.

So... the note is inconsistent with the spec, but changing the spec without a test seems weird.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/161

Received on Friday, 3 March 2017 22:19:15 UTC