Signal-iOS/SignalServiceKit/tests/Util
George Nachman 22c1cb8a22 Fetch phone numbers in a batch.
This is the first meaty part of optimizing
fetching display names.

Some contacts fall back to phone numbers as their
display names. This PR fetches them in a single
SQL query via
`OWSContactsManager.phoneNumbers(for:, transaction)`.

To achieve this, this PR introduces
`GRDBSignalAccountFinder.signalAccounts(for:,transaction:)`
to fetch many accounts at once.

In order to fetch many accounts at once, we need
to be able to fetch many values from a
ModelReadCache at once. So this PR introduces
`ModelReadCache.readValues(for:,transaction:)` and
`ModelReadCache.getValues(for:,transaction:,returnNilOnCacheMiss:)`.

Existing methods that operate on a single value
were refactored to use the batch methods.

This PR adds tests for this functionality, which
necessitated changing the visibility of various
private symbols and also improving the fake
profile manager to make it more configurable.

There's also a tiny optimization for Refinery to
avoid calling a closure that has no work to do.
This helps elide do-nothing SQL queries that would
otherwise have been introduced.
2022-03-17 12:46:33 -07:00
..
Date+SSKTest.swift Run precommit script 2020-08-13 15:08:12 -07:00
DeviceNamesTest.swift Linking flow 2019-10-17 10:19:32 -06:00
DispatchQueue+OWSTest.swift Adopt changes from precommit linting scripts 2020-07-06 13:48:59 -07:00
JobQueueTest.swift Disable unnecessary job queues from running in extensions 2021-06-24 12:20:46 -07:00
kbs_pin_sanitation_vectors.json Additional KBS vectors and normalization fix 2020-01-23 08:56:05 -08:00
kbs_storage_service_encryption_vectors.json Storage Service Encryption Finalization 2020-02-11 13:29:02 -08:00
kbs_vectors.json Additional KBS vectors and normalization fix 2020-01-23 08:56:05 -08:00
KeyBackupServiceTests.swift Silently migrate master key to new KBS enclave when necessary 2020-10-06 15:07:11 -07:00
LRUCacheTest.swift Apply LRUCache everywhere. 2021-06-30 16:01:08 -03:00
MessagePaddingTests.m Import SignalMetadataKit wholesale into SignalServiceKit 2022-01-26 09:50:55 -08:00
NSData+ImageTest.swift Fix broken tests. 2020-09-02 16:31:42 -03:00
NSURLSessionDataTask+OWS_HTTPTest.swift Respond to CR; fix broken tests. 2021-08-18 14:26:20 -03:00
OWSAnalyticsTests.m Apply script to normalize includes and imports. 2021-10-21 09:21:10 -03:00
OWSErrorTest.swift Refine names. 2021-08-18 15:01:04 -03:00
OWSOperationTest.swift Deprecate REST, Part 1 2021-08-18 14:25:36 -03:00
RefineryTest.swift Fetch phone numbers in a batch. 2022-03-17 12:46:33 -07:00
RemoteConfigManagerTests.swift PR Feedback 2020-09-21 12:08:36 -07:00
TSMessageStorageTests.m Apply script to normalize includes and imports. 2021-10-21 09:21:10 -03:00
UnfairLockTest.swift IOS-631: Suppress message processing pipeline while we have a pending backfill operation 2020-07-22 21:10:27 -07:00
ViewOnceMessagesTest.swift Rework dependency access. 2021-03-25 09:24:27 -03:00