cfjedimaster / Cordova-Examples

A collection of Cordova/Ionic/etc demos.
982 stars 1.07k forks source link

use db.connect explicitly before using collection api #28

Closed nphyatt closed 7 years ago

nphyatt commented 7 years ago

Ok so first off Thanks for the feedback!

Definitely a little bit of bugginess and some sweet race conditions going on with that one. Here is the breakdown:

Previously calling an operation would trigger an automatic connection but to avoid annoying race conditions now you will need to call this.db.connect() explicitly before attempting to query or insert data.

That means that if you're using Auth you'll want to do that after login. I made the changes to the flow in this PR. I also updated your package.json so you should be able to do an npm install to get the latest db-alpha branch. If it doesn't work you might need to rm -rf node_modules/@ionic && npm install

Let me know if this fixes your issue in Intercom or the slack channel. Thanks!