Start a new topic

Relational data, offline and angularJs bug / problem

Hi guys,

I'm developing an app for iOS and Android. I'm using AngularJS / Ionic / Phonegap.

Until recently I have not been using the kinvey references, and did embed relational data. Everything was working fine with that.

Now I'm also using kinvey references to save relational data and with that I started to experience bugs/problems with the angularJs kinvey library.

For every query, that also grabs referenced data, there is a slight chance that I encounter this bug:

**Error: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.**

![]( "")

You can not easily reproduce it. It only happens sometimes and it only happens with queries on collections with kinvey references and it also only happens with the minified version of the kinvey library.

With the much slower non-minified version I didn't encounter any problems, so I guess it is some sort of timing problem.

The current workaround is if it crashes, to use $timeout of 2000 to query again, which has a high chance of working. But even then it might crash again, then I'm asking the user to manually reload.

So this is problem numero uno.

The second problem is, that sometimes when querying a collection with referenced data, kinvey resolves the relations of some entities correct and for some I get the pure reference entry (e.g.):


That also only happens when working with either cached data or in complete offline mode.

Any ideas?


the SportThing

I am not sure what could cause the first problem - are you running inside PhoneGap, or testing in the browser?

For the second problem, I think the referenced documents are not in the cache. Therefore, the raw reference entry will be returned.
For the 1st problem:

It happens in the browser and with phonegap compiled android apks.

2nd prob. They are in the cache. I have a workaround where I check if I only get the kinvey ref. If yes, then I grab the same entry by id and now it works.

I feel the second problem might be caused by the first one, as relational data should work offline. Is there any way you could share your code so I can try and recreate the issue you are seeing?
Login or Signup to post a comment