Closed Bug 901884 Opened 11 years ago Closed 11 years ago

IndexedDB - should not onsuccess be called after onupgradeneeded?

Categories

(Core :: Storage: IndexedDB, defect)

22 Branch
x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: aymeric, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.0; rv:22.0) Gecko/20100101 Firefox/22.0 (Beta/Release)
Build ID: 20130618035212

Steps to reproduce:

var DB=indexedDB.open('test',2);
DB.onupgradeneeded=function(evt) {
	var db=evt.target.result;
	db.createObjectStore('test',{keyPath:'hash'});
};
DB.onsuccess=function (evt) {
        DB.db=evt.target.result;
	//DB.list(); call something using object store --> error
};


Actual results:

The above code produces an error when no object store has been created already.

Because onsuccess is called before onupgradeneeded.


Expected results:

Not sure what the indexedDB spec says about it but it would seem logical that onsuccess gets fired after onupgradeneeded has completed when onupgradeneeded is fired.
Component: Untriaged → DOM: IndexedDB
Product: Firefox → Core
Could you attach a testcase (html) to the bug, please.
Flags: needinfo?(avitte)
Strange, I can not reproduce it any longer now, I don't remember exactly what was the sequence but I am quite sure to have observed this behavior.

Please close it, I will reopen it if it happens again.
Flags: needinfo?(avitte)
Ok, feel free to reopen it if you have a reproducible testcase.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.