Commit Graph

129 Commits

Author SHA1 Message Date
Torsten Grote
9b5b68b740 remove non-determinism from removeAllOptionalsDiff test 2025-07-14 15:25:07 -03:00
Torsten Grote
6b304c8fa9 [db] Add test for removal of optionals from packages 2025-07-14 09:50:34 -03:00
Torsten Grote
d5fd44f718 [db] Removal of *all* packages via diff currently not supported 2025-07-14 09:50:34 -03:00
Torsten Grote
4d719af2bb [db] Fix diff removal of optionals in Repository 2025-07-14 09:50:34 -03:00
Tobias_Groza
948e22efc8 Fix and add tests for hasAuthorMoreThanOneApp(), getAppListItemsForAuthor() 2025-06-25 11:01:17 +02:00
Tobias_Groza
11c7ebf3ce De-duplicate SQL getAppListItems queries by using RawQuery 2025-06-25 11:01:17 +02:00
Tobias_Groza
c1226afab3 Use ViewModel to obtain data about app author 2025-06-25 11:01:17 +02:00
Tobias_Groza
1008cd5862 Display all apps created by a developer
This adds the abililty to click on the author's name in the app details if there are at least two app from them in the DB. A button with hint to take a look at the other  apps by the dev is also added at the bottom of the app details. When clicked, the AppList is opened with a new `authorName` filter.
2025-06-25 11:01:17 +02:00
Torsten Grote
f1c55dd38f Add ConsistentCopyVisibility annotation where required 2025-05-30 16:48:42 -03:00
Tobias_Groza
fc6a88c4b7 Fix AppListLiveData.addSource()
With the update to Room 2.7.0 the chunked queries stopped to return distinct values. This is fixed by only processing distinct values when merging the chunked results.
The test case for the chunked quries was also fixed. It did not work properly before because it only tested chunked quries and not the base case which does not need chunked packageInfo
2025-05-30 16:48:41 -03:00
Torsten Grote
bcf50780e9 Migrate from KAPT to KSP 2025-05-30 16:48:41 -03:00
Thore Goebel
319ff86744 Add testAddingMidRepoByOfficialMirror 2025-05-01 14:47:59 +02:00
Thore Goebel
5362938b28 Don't add official mirror as user mirror when adding repo via official mirror
Fixes #2981.
2025-05-01 14:47:59 +02:00
Thore Goebel
6f2f6b0cf5 Add testAddingMinRepoByUserMirror
Also pull out mockNewRepoDbInsertion() to reduce complexity and allow future reuse.
2025-05-01 10:56:16 +02:00
Thore Goebel
118362ffce Clean up RepoAdderTest
- Rename expectDownloadOfMinRepo() to mockMinRepoDownload() to better describe what it does
- Move repoAdder.fetchRepository into expectMinRepoPreview() to reduce repetition
- Change some remnant example.com to min-v1.org
- Use explicit user-mirror-min-v1.org instead of example.com to make the intention clear
- Add comments to explain what's going on
- Make mockRepoDownload() configurable, to allow easier mocking of other repos in the futures (e.g., of mid and max)

See also fdroid/fdroidclient!1535

This clean up was prompted by the need to write a test for fdroid/fdroidclient!1530
2025-05-01 10:35:16 +02:00
Torsten Grote
3f142da1c1 Improve RepoAdderTest by changing test data 2025-04-28 10:33:43 -03:00
Torsten Grote
1955f551e1 Respect preferred repo for category apps count 2025-04-14 09:26:40 -03:00
Torsten Grote
f94e8725b8 Allow duplicate permissions in DbTest 2025-03-24 15:17:46 -03:00
Torsten Grote
af03820b73 Disable archive repo when disabling main repo 2025-03-12 09:36:53 -03:00
Torsten Grote
d17e1c5bcf Delete archive repo when deleting main repo 2025-03-11 09:33:16 -03:00
Thore Goebel
96ce5be721 Review feedback 2025-02-06 22:02:09 +01:00
Thore Goebel
927621f364 Redesign RepoDetailsActivity 2025-02-06 22:02:05 +01:00
Thore Goebel
70046f3478 Refactor: move QR Code generation into RepoDetailsViewModel 2025-01-29 14:57:04 +01:00
Torsten Grote
8a676010ba [db] rename location to countryCode in Mirror 2024-11-07 14:36:12 -03:00
Torsten Grote
1ba3d00b78 [db] Allow AppPrefs.preferredRepoId to be set to a repo that doesn't contain the app 2024-11-07 10:17:58 -03:00
Torsten Grote
05b9157b27 When clearing all data, also reset ETags
otherwise the v1 repos still relying on them would not re-update and thus the DB miss their data. This can cause unintended breakage like apps not having a preferred repo.
2024-10-21 16:27:37 +00:00
Torsten Grote
195911c765 Fixing Kotlin style issues ahead of ktlint upgrade 2024-10-17 17:41:12 +00:00
Torsten Grote
93e973e2b9 There's an official DigestInputStream, no need to make our own 2024-10-11 17:29:22 -03:00
DerGenaue
61361154b1 MR comments 2024-10-11 16:35:23 +00:00
DerGenaue
445f521b1f Move walCheckpoint to RepositoryDao 2024-10-11 16:35:23 +00:00
DerGenaue
38ce497525 DB: Force a wal_checkpoint after every repo update to keep the wal file small (fixes #2588) 2024-10-11 16:35:23 +00:00
Torsten Grote
7a5f133759 Improve error reporting for update checking 2024-10-09 09:45:28 -03:00
Torsten Grote
cfaf9a5ad2 [db] Fix concurrent index updates
If we are used to update the same repo at almost the same time, a race-condition can happen that tries to apply a diff to an already updated DB. We don't download anything while holding a DB transaction, so the download and check for the repo timestamp happens before we enter the transaction. However, we forgot to re-check the timestamp again within the transaction to be sure the DB state is still as expected.
2024-10-08 17:14:24 +00:00
Torsten Grote
9f637a602c [app] Don't crash on malformed fdroid.link Uri
Fixes acra-crash-reports#740
2024-09-13 08:35:33 +00:00
Tobias_Groza
f927e7c86d Add test for AppMetadataFTS table migration 2024-09-03 19:06:10 +02:00
Tobias_Groza
14ffc7023b Update tests to use new db schema and migrations 2024-09-03 19:06:10 +02:00
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
510a6c07f3 [db] return the repoId of the archive when adding/enabling it 2024-07-12 09:31:37 -03: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
Ray c
190d06e109 Improve locales list ordering of less common languages 2024-06-14 14:27:22 +00:00
Thore Goebel
06fa581d3f Clarify FetchResult computation 2024-05-27 15:24:45 +02:00
Thore Goebel
a26d5fe727 Remove unused Repository.canAdd and Repository.isMirror functions 2024-05-27 15:24:45 +02:00
Thore Goebel
199f9b6c52 Rename Fetching.repo to Fetching.receivedRepo
To make it clear that this is the repo as we received it,
not the repo as we may have already stored it in the database.
2024-05-27 15:24:45 +02:00
Thore Goebel
d3ac70276d fix: Use existingRepoId instead of receivedRepoId to launch existing details 2024-05-27 15:24:45 +02:00
Thore Goebel
e963aeaece Make ktlint happy
For the record: I strongly find the trailing && and ||
less readable than the leading version.
But if that's what the Kotlin folks want 🤷.
2024-05-27 15:24:45 +02:00
Thore Goebel
f173b1b6dc Distinguish IsNewRepoAndNewMirror in UI 2024-05-27 15:24:45 +02:00
Thore Goebel
ee8dadf577 Explain what is being tested 2024-05-27 15:24:45 +02:00
Thore Goebel
ca2c97a8cf Distinguish IsExistingRepository from IsExistingMirror 2024-05-27 15:24:45 +02:00
Thore Goebel
bae2a06693 Refactor: Move fetchUrl up from FetchResult into Fetching
The fetchUrl is independent of the result, it better belongs into Fetching.
2024-05-27 15:24:45 +02: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