IndexedDB - should not onsuccess be called after onupgradeneeded?

RESOLVED INVALID

Status

()

Core
DOM: IndexedDB
RESOLVED INVALID
4 years ago
4 years ago

People

(Reporter: Aymeric Vitte, Unassigned)

Tracking

22 Branch
x86
Windows Vista
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
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.

Updated

4 years ago
Component: Untriaged → DOM: IndexedDB
Product: Firefox → Core

Comment 1

4 years ago
Could you attach a testcase (html) to the bug, please.
Flags: needinfo?(avitte)
(Reporter)

Comment 2

4 years ago
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)

Comment 3

4 years ago
Ok, feel free to reopen it if you have a reproducible testcase.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.