-
Notifications
You must be signed in to change notification settings - Fork 714
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
Cannot perform deleteDatabase reliably #112
Comments
This seems like something we should be able to write a unit test for in order to reproduce. We have a unit test that just opens a database and destroys it (which passes on Android and iOS but is ignored on WP8 for now). A unit test that opens, closes, and destroys a database would be a welcome addition. |
OK |
Guys, I am planning to submit this plugin to the PhoneGap build early next Chris |
@brodybits +1. Wouldn't bother disabling, though; how about we just say they're experimental in the README? |
Fine by me. I probably won't even get a chance to right the unit tests On 8 August 2014 17:38, Nolan Lawson [email protected] wrote:
|
I have a fork with the unit tests for the delete and callback bugs I've reported. I've started working on fixes for android + wp8 (iOS will have to wait). Please advise: would you prefer that I paste the unit tests here, or provide a pull request or carry on until I can provide the fixes? |
I suspect the callback bug should be a pretty simple fix in the
If you issue a pull request on the tests, it is easiest for me if you can If you issue a pull request on the fixes: for Android and/or iOS, it is For WP(8), it is easiest for me if you issue the pull request on the Many thanks for your help, |
Thanks for the advice - I'm new to github and just feeling my way. I believe that the only one which is a simple js/coffeescript bug is the double invoked executeSql callback. The un-invoked close and open callbacks are also fairly simple, but need to be added to the java (and probably c#) as well as, in the close case, the coffeescript. The android delete issues are java based and require a bit of thought. |
@Typhlosaurus Feel free to break it up into many smaller PRs if you are able to. It makes it easier for us to digest when we review your changes. |
Also thank you a ton for your work! |
|
Don't thank me for my work until you've seen some! I've just submitted a PR for the unit tests - unfortunately I didn't see the split request until too late. I'll send the subsequent PRs seperately. |
Chirs |
@brodybits Goes without saying, but please test on multiple devices before merging, since for the time being we don't have any automated tests. If you need help, I have tons of Android devices myself that I can test on. Speaking of which, do you think maybe we could get an Open Sauce account? It's awesome when you can just glance at a PR and see whether it had a green check in Travis or not. |
Absolutely and I would appreciate your help with the Android devices. I will work on the Open Sauce account, but do not want to hold up the PhoneGap integration for this. Chris |
…ng openDatabase()/db.close()/deleteDatabase() callbacks; double db.executeSql() callbacks; deleteDatabase() not reliable); small changes to deleteAndConfirmDeleted() helper function for existing test of sqlitePlugin.deleteDatabase()
… WP(8) open/close/delete issues (ref: #109/#110/#112); fix integer data binding (#123); credit for WP(8) fixes to [email protected]
Now fixed in |
deleteDatabase works differently on the three supported platforms:
WP8: not supported but reports success.
Android: supported and works if the database is closed. if the database is open it closes the database immediately and removes the runner from the map before trying to delete the database; it does not tell the thread responsible for the database that the database has been closed.
iOS (by inspection, not tested): does not appear to try to close the database but simply tries to delete the file. My guess is that this will fail if the database is open. It also appears not to delete any secondary WAL files, but my knowledge of the iOS API is pretty well non-existent.
These matter as it is currently impossible to determine when a database.close() call has completed (see #109) making it tricky to either close before deleting or close and then perform file delete(s).
The text was updated successfully, but these errors were encountered: