Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content

Improve Database to avoid SQLiteLog: (28) double-quoted string literal

Vincent Bourgmayer requested to merge 659-o-improve-DB into v1-oreo

Description

This MR, rewrite some operation done on database. The goal is to not have the following kind of logs

10-13 15:17:59.340  2979  3392 W SQLiteLog: (28) double-quoted string literal: "/data/data/foundation.e.drive/files/tmp_packages_list.csv"
10-13 15:17:59.361  2979  2979 W SQLiteLog: (28) double-quoted string literal: ""
10-13 15:18:13.091  2979  3392 W SQLiteLog: (28) double-quoted string literal: "/storage/emulated/0/DCIM/OpenCamera/0e70e4553326b231075e741a8acb1e18--wolf-carving-whittling.jpg"

Tests

Run synchronization, Look at logcat. If you still see SQLiteLog warning like above, then it's not fixed.

Example of unexpected logs:
10-13 15:17:33.520  2979  2979 I ObserverService: onStartCommand(1)
10-13 15:17:33.532  2979  2979 I ObserverService: clearCachedFile()
10-13 15:17:33.540  2979  2979 I ObserverService: deleteOldestCrashLogs()
10-13 15:17:33.545  2979  2979 I ObserverService: startScan(true)
10-13 15:17:33.788  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Pictures/
10-13 15:17:33.793  2979  4999 D AdvancedSslSocketFactory: Creating SSL Socket with remote eeo.one:443, local null:0, params: org.apache.commons.httpclient.params.HttpConnectionParams@3060a1c
10-13 15:17:33.793  2979  4999 D AdvancedSslSocketFactory:  ... with connection timeout 60000 and socket timeout 60000
10-13 15:17:33.799  2979  4999 I ServerNameIndicator: SNI done, hostname: eeo.one
10-13 15:17:34.955  2979  4999 I ReadFolderRemoteOperation: Synchronized /Pictures/: Operation finished with HTTP status code 207 (success)
10-13 15:17:35.291  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Music/
10-13 15:17:36.310  2979  4999 I ReadFolderRemoteOperation: Synchronized /Music/: Operation finished with HTTP status code 207 (success)
10-13 15:17:36.489  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Music/Sound%20records/
10-13 15:17:37.476  2979  4999 I ReadFolderRemoteOperation: Synchronized /Music/Sound records/: Operation finished with HTTP status code 207 (success)
10-13 15:17:37.644  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Ringtones/
10-13 15:17:38.854  2979  4999 I ReadFolderRemoteOperation: Synchronized /Ringtones/: Operation finished with HTTP status code 207 (success)
10-13 15:17:39.025  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Photos/
10-13 15:17:40.015  2979  4999 I ReadFolderRemoteOperation: Synchronized /Photos/: Operation finished with HTTP status code 207 (success)
10-13 15:17:40.343  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Movies/
10-13 15:17:41.328  2979  4999 I ReadFolderRemoteOperation: Synchronized /Movies/: Operation finished with HTTP status code 207 (success)
10-13 15:17:41.496  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Documents/
10-13 15:17:42.677  2979  4999 I ReadFolderRemoteOperation: Synchronized /Documents/: Operation finished with HTTP status code 207 (success)
10-13 15:17:42.845  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Podcasts/
10-13 15:17:43.829  2979  4999 I ReadFolderRemoteOperation: Synchronized /Podcasts/: Operation finished with HTTP status code 207 (success)
10-13 15:17:44.299  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Pictures/Screenshots/
10-13 15:17:45.518  2979  4999 I ReadFolderRemoteOperation: Synchronized /Pictures/Screenshots/: Operation finished with HTTP status code 207 (success)
10-13 15:17:45.689  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Photos/bob/
10-13 15:17:46.635  2979  4999 E ReadFolderRemoteOperation: Synchronized /Photos/bob/: Local file does not exist
10-13 15:17:46.816  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Photos/bob/toto/
10-13 15:17:48.008  2979  4999 E ReadFolderRemoteOperation: Synchronized /Photos/bob/toto/: Local file does not exist
10-13 15:17:48.186  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Photos/bob/toto/titi/
10-13 15:17:49.127  2979  4999 E ReadFolderRemoteOperation: Synchronized /Photos/bob/toto/titi/: Local file does not exist
10-13 15:17:49.204  2979  3392 W SQLiteLog: (28) double-quoted string literal: "/storage/emulated/0/DCIM/bob/toto/titi"
10-13 15:17:49.328  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Photos/OpenCamera/
10-13 15:17:50.669  2979  4999 I ReadFolderRemoteOperation: Synchronized /Photos/OpenCamera/: Operation finished with HTTP status code 207 (success)
10-13 15:17:50.835  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Documents/patapompom/
10-13 15:17:51.766  2979  4999 E ReadFolderRemoteOperation: Synchronized /Documents/patapompom/: Local file does not exist
10-13 15:17:51.829  2979  3392 W SQLiteLog: (28) double-quoted string literal: "/storage/emulated/0/Documents/patapompom"
10-13 15:17:51.961  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Documents/Vincent%20Bourgmayer/
10-13 15:17:53.071  2979  4999 E ReadFolderRemoteOperation: Synchronized /Documents/Vincent Bourgmayer/: Local file does not exist
10-13 15:17:53.247  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Documents/Vincent%20Bourgmayer/2021/
10-13 15:17:54.183  2979  4999 E ReadFolderRemoteOperation: Synchronized /Documents/Vincent Bourgmayer/2021/: Local file does not exist
10-13 15:17:54.247  2979  3392 W SQLiteLog: (28) double-quoted string literal: "/storage/emulated/0/Documents/Vincent Bourgmayer/2021"
10-13 15:17:54.372  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Documents/Vincent%20Bourgmayer/2020/
10-13 15:17:55.487  2979  4999 E ReadFolderRemoteOperation: Synchronized /Documents/Vincent Bourgmayer/2020/: Local file does not exist
10-13 15:17:55.544  2979  3392 W SQLiteLog: (28) double-quoted string literal: "/storage/emulated/0/Documents/Vincent Bourgmayer/2020"
10-13 15:17:55.678  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Documents/Vincent%20Bourgmayer/2019/
10-13 15:17:56.646  2979  4999 E ReadFolderRemoteOperation: Synchronized /Documents/Vincent Bourgmayer/2019/: Local file does not exist
10-13 15:17:56.714  2979  3392 W SQLiteLog: (28) double-quoted string literal: "/storage/emulated/0/Documents/Vincent Bourgmayer/2019"
10-13 15:17:56.831  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Documents/Bricolage/
10-13 15:17:57.910  2979  4999 E ReadFolderRemoteOperation: Synchronized /Documents/Bricolage/: Local file does not exist
10-13 15:17:57.957  2979  3392 W SQLiteLog: (28) double-quoted string literal: "/storage/emulated/0/Documents/Bricolage"
10-13 15:17:58.101  2979  4999 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Documents/Art-martiaux/
10-13 15:17:59.034  2979  4999 E ReadFolderRemoteOperation: Synchronized /Documents/Art-martiaux/: Local file does not exist
10-13 15:17:59.081  2979  3392 W SQLiteLog: (28) double-quoted string literal: "/storage/emulated/0/Documents/Art-martiaux"
10-13 15:17:59.286  2979  2979 I ObserverService: startScan(false)
10-13 15:17:59.291  2979  2979 I DbHelper: scanLocalFiles()
10-13 15:17:59.334  2979  3392 W SQLiteLog: (28) double-quoted string literal: "/data/data/foundation.e.drive/files/tmp_packages_list.csv"
10-13 15:17:59.337  2979  2979 W SQLiteLog: (28) double-quoted string literal: ""
10-13 15:17:59.340  2979  3392 W SQLiteLog: (28) double-quoted string literal: "/data/data/foundation.e.drive/files/tmp_packages_list.csv"
10-13 15:17:59.361  2979  2979 W SQLiteLog: (28) double-quoted string literal: ""
10-13 15:17:59.449  2979  2979 I chatty  : uid=10118(foundation.e.drive) identical 4 lines
10-13 15:17:59.475  2979  2979 W SQLiteLog: (28) double-quoted string literal: ""
10-13 15:17:59.557  2979  2979 I SynchronizationService: startAllThreads
10-13 15:17:59.568  2979  5016 D OwnCloudClient #0: REQUEST DELETE /remote.php/dav/files/00020@eeo.one//Documents/Example.md
10-13 15:17:59.572  2979  5017 D OwnCloudClient #0: REQUEST DELETE /remote.php/dav/files/00020@eeo.one//Documents/Jester%20of%20the%20moon.gpx
10-13 15:17:59.575  2979  5017 D AdvancedSslSocketFactory: Creating SSL Socket with remote eeo.one:443, local null:0, params: org.apache.commons.httpclient.params.HttpConnectionParams@1ea1f31
Example of expected logs: ``` 10-13 15:36:43.414 3115 3115 I ObserverService: onStartCommand(1) 10-13 15:36:43.422 3115 3115 I ObserverService: clearCachedFile() 10-13 15:36:43.425 3115 3115 I ObserverService: deleteOldestCrashLogs() 10-13 15:36:43.427 3115 3115 I ObserverService: startScan(true) 10-13 15:36:43.598 3115 28791 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Pictures/ 10-13 15:36:43.606 3115 28791 D AdvancedSslSocketFactory: Creating SSL Socket with remote eeo.one:443, local null:0, params: org.apache.commons.httpclient.params.HttpConnectionParams@9cc8c7 10-13 15:36:43.607 3115 28791 D AdvancedSslSocketFactory: ... with connection timeout 60000 and socket timeout 60000 10-13 15:36:43.659 3115 28791 I ServerNameIndicator: SNI done, hostname: eeo.one 10-13 15:36:44.944 3115 28791 I ReadFolderRemoteOperation: Synchronized /Pictures/: Operation finished with HTTP status code 207 (success) 10-13 15:36:45.117 3115 28791 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Music/ 10-13 15:36:46.091 3115 28791 I ReadFolderRemoteOperation: Synchronized /Music/: Operation finished with HTTP status code 207 (success) 10-13 15:36:46.261 3115 28791 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Ringtones/ 10-13 15:36:47.329 3115 28791 I ReadFolderRemoteOperation: Synchronized /Ringtones/: Operation finished with HTTP status code 207 (success) 10-13 15:36:47.502 3115 28791 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Photos/ 10-13 15:36:48.470 3115 28791 I ReadFolderRemoteOperation: Synchronized /Photos/: Operation finished with HTTP status code 207 (success) 10-13 15:36:48.637 3115 28791 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Movies/ 10-13 15:36:49.695 3115 28791 I ReadFolderRemoteOperation: Synchronized /Movies/: Operation finished with HTTP status code 207 (success) 10-13 15:36:49.865 3115 28791 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Documents/ 10-13 15:36:50.672 3115 28791 I ReadFolderRemoteOperation: Synchronized /Documents/: Operation finished with HTTP status code 207 (success) 10-13 15:36:50.843 3115 28791 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Podcasts/ 10-13 15:36:51.945 3115 28791 I ReadFolderRemoteOperation: Synchronized /Podcasts/: Operation finished with HTTP status code 207 (success) 10-13 15:36:52.419 3115 28791 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Pictures/Screenshots/ 10-13 15:36:53.330 3115 28791 I ReadFolderRemoteOperation: Synchronized /Pictures/Screenshots/: Operation finished with HTTP status code 207 (success) 10-13 15:36:53.500 3115 28791 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Photos/OpenCamera/ 10-13 15:36:54.743 3115 28791 I ReadFolderRemoteOperation: Synchronized /Photos/OpenCamera/: Operation finished with HTTP status code 207 (success) 10-13 15:36:54.908 3115 28791 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/00020@eeo.one//Music/Sound%20records/ 10-13 15:36:55.854 3115 28791 I ReadFolderRemoteOperation: Synchronized /Music/Sound records/: Operation finished with HTTP status code 207 (success) 10-13 15:36:55.864 3115 3115 I ObserverService: startScan(false) 10-13 15:36:55.876 3115 3115 I DbHelper: scanLocalFiles() 10-13 15:36:56.369 3115 3115 I SynchronizationService: startAllThreads 10-13 15:36:57.472 3115 28796 D OwnCloudClient #0: REQUEST MKCOL /remote.php/dav/files/00020@eeo.one//Photos/OpenCamera/ 10-13 15:36:57.538 3115 28797 D OwnCloudClient #0: REQUEST MKCOL /remote.php/dav/files/00020@eeo.one//Photos/OpenCamera/ 10-13 15:36:57.541 3115 28797 D AdvancedSslSocketFactory: Creating SSL Socket with remote eeo.one:443, local null:0, params: org.apache.commons.httpclient.params.HttpConnectionParams@1c965c ```

Issues

https://gitlab.e.foundation/e/os/backlog/-/issues/659

10 commandments of code reviews

👪 https://gitlab.e.foundation/internal/wiki/-/wikis/development/code-review

Merge request reports

Loading