-
Notifications
You must be signed in to change notification settings - Fork 715
Description
I have an Ionic app which uses this plugin to store data in a single table and I get an issue where I execute a query on the table and I receive no success or error callback instead it just hangs. It has happened on a Samsung S4 and S6 but I dont have a IOS test device so cannot confirm if its the same for IOS as well.
Closing the app and re-opening it opens the DB again and things start working again.
I have no idea what chain of events cause this (it just seems random) so replicating it is hard but my app consists of inserting a single record into said table, selecting ALL from table, updating a single record, and deleting a single record.
Also, it doesn't happen very often so 90% of the time the queries I have written will work as expected.
Just to note:
- I use the ng-cordova wrapper class $cordovaSQLite.execute() so that queries get returned as promises.
- I'm not working with much data either. It can happen with just 1-5 records in the table.
If you need more info or you want to see code let me know.
Update
I think I've found the cause for this. I have a list in one of my views and for each item there is an option to open it in the native Google maps app on the device. When I click this and then return to the app the database stops working. By not working I mean none of my queries return a success or error callback.
My code that opens the native map is:
function OpenMap(sLat, sLng, eLat, eLng) {
var googleUrl = 'http://maps.google.com/maps?saddr=' + sLat + ',' + sLng + '&daddr=' + eLat + ',' + eLng;
window.open(encodeURI(googleUrl), '_blank');
}