7 Commits

Author SHA1 Message Date
Tobias_Groza
1e7324ca3b Fix case insensitive search containing diacritics by changing FTS4 tokenizer
The default `simple` tokenzier config used in Room/SQLite3 FTS4 makes only ASCII characters case insensitive. The SQLite FTS3/4 doc [1] says:

> All uppercase characters within the ASCII range (Unicode codepoints less than 128), are transformed to their lowercase equivalents as part of the tokenization process. Thus, full-text queries are case-insensitive when using the simple tokenizer.

> The remove_diacritics option may be set to "0", "1" or "2". The default value is "1". If it is set to "1" or "2", then diacritics are removed from Latin script characters as described above. However, if it is set to "1", then diacritics are not removed in the fairly uncommon case where a single unicode codepoint is used to represent a character with more that one diacritic. [...] This is technically a bug, but cannot be fixed without creating backwards compatibility problems. If this option is set to "2", then diacritics are correctly removed from all Latin characters.

This change makes use of the intended behaviour by using the `unicode61` tokenizer with the `diacritics="0"` option to keep the behaviour similar to the current one. This replaces the previously used `simple` tokenizer. A migration is necessary to recreate the AppMetadataFts table to make use of the different tokenizer.

[1] https://www.sqlite.org/fts3.html#tokenizer
2024-09-03 19:06:10 +02:00
Torsten Grote
fb041c4450 [db] Fix bug where disabled repos were considered for preferred repo calculation
If an update was available from a disabled repo with a higher priority, the update from an enabled repo with a lower priority would not be offered as an update (i.e. returned by DbUpdateChecker#getUpdatableApps()).
2024-07-09 16:02:37 +00:00
Torsten Grote
fa65084e60 [db] make repo certs non-null and remove repos without cert
historically, repos were added to the DB without much information and could stay in a broken state until manually removed. If a repo is updating, it should have a cert. So only repos that never did a single index update don't have a cert. Nowadays, this can not happen anymore as we get the repo and its cert before adding it to the DB. So whenever we update a repo, we know its certificate and fingerprint. Thus, this includes a DB migration removing all broken repos and making the certificate for repos in the DB non-null.
2024-05-22 09:58:05 +00:00
Torsten Grote
ead8bd1262 [db] Only consider preferred versions for updates and suggested version 2024-02-20 09:42:39 -03:00
Torsten Grote
704234c9df [db] allow setting a preferred repo per app 2024-02-20 09:42:38 -03:00
Torsten Grote
818767b6c0 Update Room DB schema to match actual schema used 2022-12-15 17:10:08 +00:00
Torsten Grote
f6075848e7 Move libraries into their own folder
and remove sharedTest symlink hack. The shared tests are now a proper gradle module to avoid issues with using the same source files in different modules.
2022-09-12 09:46:15 +00:00