-
Notifications
You must be signed in to change notification settings - Fork 55
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
any reports of hangs with [email protected] and later ? #86
Comments
I am by far no master at this (I have my own issue opened lol) but I see no one is trying to help you, so maybe I could ask some questions they might. I will be using mostly knowledge from my week of trying to fix my own issue so apologies lol. Are any errors thrown or does it just hang as you stated? |
Thanks for the help. I use sqlexecute |
The one thing I can think of is to be extra careful not to do anything with this plugin before you receive the deviceready event. This is a very unfortunate characteristic of Cordova. Similar issue reported in storesafe/cordova-sqlite-storage#900, as a cross-reference. |
Definitely waiting on deviceready... I have unfortunately not been able to narrow it down (due to various build issues), but using an old APK on a device that has issues always seems to work, so I believe something has changed. |
Interesting, thanks @jhjulkun. So at this point, we have one app that does work with your ~25MB db file and another app that is affected by some kind of an issue. I would now recommend you try out a couple more ideas:
Seems to be basically try one thing at a time to figure out what does and does not work properly. I suspect it could help some others if you can figure this one out. |
Interesting: so added the sample.db from the starter and running the showFirst() as the first query (and only when it has completed I run my normal code) Looking at the log, the plugin claims the sample.db is opened: But then the app then crashes with: Whats interesting is that it does not crash every time, but say maybe every 2nd time ? Almost sounds like file I/O has not been flushed before cordova starts running ? I know for sure I have not seen that exact message (before the hack), but maybe I don't catch all errors ? |
Spent some more time on this, and it seems to be that ActivityManager kills (something in the app) every so often on launch. I googled for a workaround, but could not find anything that helps. So in short: I believe that since the plugin runs as a background thread, and when it consumes too much power then ActivityManager kills it. In the ADB log below the app runs on the 2nd launch, and the DB thread is killed on the 1st attempt. ActivityManager: Start proc 3664:zzz.yyy.xxx/u0a322 for activity {zzz.yyy.xxx/zzz.yyy.xxx.MainActivity} ActivityManager: Killing 3664:zzz.yyy.xxx/u0a322 (adj 905): remove task <<< killed!! ActivityManager: Scheduling restart of crashed service zzz.yyy.xxx/org.chromium.content.app.SandboxedProcessService0:0 in 1000ms |
Without a reproducible example there is not so much that I or anyone else can do to help you from here, closing now. |
Now that I have a better idea of what causes the hang, maybe I can make a testcase ? Update: the ActivityManager lead was totally false, your starter app kept working... Finally realized index.html loaded this manually, but the starter doesn't... |
Thanks for a great plugin!
I have been trying to create a shorter testcase (using cordova-sqlite-ext-bootstrap-starter-app), but no luck so far.
But just wondering if you have any ideas why the first transaction on an open database simply just seems to hang (on later versions, and seems to happen more frequently in Android10).
On my Pixel(1) my app only works every fourth time or so.
The iOS version does not seem to have this issue.
I can't for sure say when it started happening, I'll try figuring that out next (I'm using a non published plugin, and the cordova --noregistry or --nofetch seems to be ignored so its non
trivial to try different releases)
But I know plugin worked well in:
[email protected] and cordova-sqlite-ext 0.10.0
In the (non complete) codesnippet below, "rowData" is never printed when it does not work.
Thanks!
The text was updated successfully, but these errors were encountered: