Bug 21801 - [IndexedDB] Cursor operations when source deleted are not defined
Summary: [IndexedDB] Cursor operations when source deleted are not defined
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Indexed Database API (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Joshua Bell
QA Contact: public-webapps-bugzilla
Depends on:
Reported: 2013-04-23 19:39 UTC by Joshua Bell
Modified: 2013-04-26 17:04 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Bell 2013-04-23 19:39:58 UTC
In a version change transaction:

store = db.createObjectStore("store");
store.put(0, 0); // throws InvalidStateError since object is deleted

But consider:

store = db.createObjectStore("store");
store.put(0, 0);
store.openCursor().onsuccess = function(e) {
  var cursor = e.target.result;
  if (cursor) {

The behavior here does not appear to be specified. It seems to me it should also throw InvalidStateError. This could be specified by adding to the operation descriptions for IDBIndex continue, advance, update and delete:

"If the cursor's source or effective object store has been deleted, the implementation MUST throw a DOMException of type InvalidStateError."

(The same would apply to operations on an index if its object store is deleted. That also seems underspecified.)
Comment 1 Joshua Bell 2013-04-26 17:04:11 UTC
Resolved in https://dvcs.w3.org/hg/IndexedDB/rev/192dbbcb896f

This may be considered a normative change, but the previous behavior in this case would be undefined.