[AC-5477] Querying remotely loaded database fails with disk i/o error in 7.0.0, works in 6.3.0
GitHub Issue | n/a |
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2018-01-20T06:36:24.000+0000 |
Affected Version/s | Appcelerator Studio 4.5.0 |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Jeroen van Vianen |
Assignee | Shak Hossain |
Created | 2017-12-28T11:11:35.000+0000 |
Updated | 2018-03-18T15:03:29.000+0000 |
Description
I have a use-case where a database is not available locally and needs to be fetched from a URL, uncompressed, installed and then queried. This works fine in 6.3.0.GA but fails in 7.0.0.GA. This is an awkward user experience where the user is requested to download a database file, sees an alert box that the database has been successfully installed but when he tries to query it, there is no data and the user is requested to download the database file again.
However, after quitting the app and restarting it, the database has actually been installed and the app works as expected (both on device and simulator).
I've attached a stripped down JS snippet which shows the logic that I've been doing. The real code is slightly more complicated.
The error reported is:
{"line":151,"column":31,"sourceURL":"file:///Users/USERNAME/Library/Developer/CoreSimulator/Devices/411028DF-C46E-463D-A889-AAAC9C3AABC5/data/Containers/Bundle/Application/D32FCC20-2DF6-4746-86EA-60FA295D650C/APP.app/db.js","nativeReason":"Error Domain=com.plausiblelabs.pldatabase Code=3 \"An error occured parsing the provided SQL statement.\" UserInfo={com.plausiblelabs.pldatabase.error.query.string=select count(*) from table, com.plausiblelabs.pldatabase.error.vendor.code=10, com.plausiblelabs.pldatabase.error.vendor.string=disk I/O error, NSLocalizedDescription=An error occured parsing the provided SQL statement.}","nativeLocation":"-[TiDatabaseProxy execute:] (TiDatabaseProxy.m:184)"}
Attachments
File | Date | Size |
ac5477.zip | 2018-01-02T08:48:16.000+0000 | 6616 |
app.js | 2017-12-29T22:04:42.000+0000 | 1881 |
snippet.js | 2017-12-28T11:10:40.000+0000 | 1845 |
Hello, Please create a full reproducible sample code/project. We will investigate it. Thanks.
Hi Sharif, I added an app.js, that illustrates the problem; it has no UI, just look at the log messages.
Hello, We need the ti.compression module for us to test. Please send a full sample project.
Hi Sharif, ti.compression is http://gitt.io/search?q=ti.compression
Hello [~morinel], Thanks for your feedback. It would be better if you can provide a sample test project to reproduce this on our end? Best
Is the attached ZIP file sufficient?
Hello [~morinel], Tested the zip file provided by you and unable to reproduce the error. *Test steps:* 1. Download the zip file. 2. Open studio, create a sample classic project and paste the sample app.js file 3. Include ti.compression module from [here](https://github.com/appcelerator-modules/ti.compression/releases) 4. Run it via simulator *Test Result:*
Very strange, I get the following output when running from the simulator:
[~morinel], Can you please share your *appc info* here?
Hello [~morinel], I also tried your sample code on iOS. I am unable to reproduce the issue. Below is my log
Can you try checking upgrade options in the studio and any possible upgrades? Thanks.
Just for posterity, I was able to resolve the issue by doing the following: