-
Notifications
You must be signed in to change notification settings - Fork 13
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
[Capacitor] Forward slash stripped from string values when inserting/updating rows on Android device #61
Comments
Hello @jarrodkoch thanks for reporting. Yes I would also not want you to post any company source code in an issue like this which is publicly accessible. Considering that I have recently tested with the forward slash ( For private, commercial support I think your company has already reached out to me. In case anyone else may be interested in private support please reach out to: [email protected] |
I have a "small" reproduction (it's mostly boilerplate). https://github.com/jarrodkoch/sqlite This is an ionic hybrid app. I'm not sure how familiar you are with these. I'm hoping these steps will work for you without further fiddling. Note that you will need Android Studio installed to build the app. After you have the repo pulled locally, run 'npm ci' within the repo's directory to get the project dependencies. After that, run 'ionic capacitor build', and follow the prompts. You will be building for Android. This will open the project in Android Studio once it is built, and from there you can deploy to your device. The UI is very basic. Inside the black border in the center is an input field. Input a value, and tapping submit will insert this value into sqlite and read the value back from sqlite, and display it on the screen. If the value contains a /, it will be stripped out on insertion into the database. The logic most likely to be interesting to you is located in ./src/service/database.service.ts. |
Hi thanks for the reproduction. I have not tested or supported this plugin with Ionic Capacitor before and am not in a position to promise anything outside of the commercial support at this time. |
@brodybits slogged through creating a similar ionic/cordova test app and I do not see the behavior on that platform of the forward slash characters being stripped out. If it was not your intent to support capacitor with this plugin feel free to close this issue. |
I'll leave the capacitor test repo in place if you want to play around with it at all. |
I have just come across this issue! This is what Capacitor is sending according the the logger
Then I run a get and this is what is sent
Which returns:
I also tried using a 1 line SQLBatch and it does the same thing, using the Batch method I added a debug statement into the execute method of SQLitePlugin.java as Which returns:
So it would appear that the argsAtString arrives to the plugin source with an escaped string which I would have thought would have been fine. So I decided to cordova compile the app and insert the same log statement and it shows this:
So the contents of the string are not escaped but the string quotes are. A dirty fix would be: Have sent you a pm but wanted to document this as it highlights the issue and I just want to check that will will not break anything else? |
Hello,
I am attempting to use this plugin as an alternative to another one which I cannot continue to use due to non-support of the Android V30 SDK, which is required as of November of this year. The plugin is being utilized in an Ionic/Angular hybrid application targeting iOS and Android. Everything seemed fine with this as a direct replacement in iOS, but on Android, values inserted/updated into text columns which contain the / character (forward slash) end up with the forward slash character stripped out when they get into the database.
I attempted various escape sequences, but everything I tried resulted in all / characters being stripped out.
I am unable to find any configuration/settings which might cause this behavior. Also, it is occurring only on Android.
Company policy does not allow for providing you access to the application source, and I'm not sure how I might provide a smaller reproduction (if I had one) as I don't know you you might consume it.
The text was updated successfully, but these errors were encountered: