-
-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage version gets increased but not all indexes are created #100
Comments
Thanks for finding. I'll try to reproduce it in a unit test later on today. |
@dfahlander Thanks. While this should definitely not fail silently, I now question my approach using all the compound indexes. I have read the article, that Is |
Nope. Compound indexes are the best pick for 'and' operations. The and() method is just a javascript filter. |
Found one possible issue: "[autoCreated+countryRef+needsReview+isDeleted]" is entered twice. Still examining why it fails silently... |
Actually it is not failing silently if you've catched the db.open() call, or a subsequent call to use the database. It failed actually to open. It's still an issue that the half-created database is still there and that the upgrade transaction is not aborted correctly, which I now trigger in a unit test and will resolve (not committed yet). For your application though, just remove your duplicate index name "[autoCreated+countryRef+needsReview+isDeleted]". You might need to delete the database and recreate it because it was left in that half-upgraded state due to this issue. |
Strange, I actually look for errors on db.open: db.open()
.then(() => {
console.log('opened the database');
})
.catch(function(error) {
alert('Uh oh : ' + error);
}); Since this is just a a development setup for now deleting the DB is no problem. For future reference: Is inserting an empty intermediate version like this |
It's not strange when I think about it. In my tests I always recreate the
|
I fixed the issue by always aborting the upgrade-transaction if any error occur. However, after running the unit test suite there has been some problems with other unit tests that I need to investigate. |
For example, this is part of my storage definition:
Those are by my count 17 indexes.
But not all of them get created, even though the version gets incremented in the browser.
Firefox: 13 / 17 indexes:

Chrome: 15 / 17 indexes:

Any ideas?
The text was updated successfully, but these errors were encountered: