Signal-iOS/SignalServiceKit/src/TestUtils
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
..
Factories.swift Record uniqueIds of messages that receipt messages refer to 2021-07-29 20:40:40 -07:00
FakeAccountServiceClient.swift Store the local PNI alongside the local ACI and phone number 2022-03-14 12:59:44 -07:00
FakeContactsManager.swift Introduce Refinery to help batch DB queries. 2022-03-04 10:44:07 -08:00
FakeStorageServiceManager.swift Convert to new Promise library 2021-09-03 11:41:34 -07:00
MockSSKEnvironment.h Fetch phone numbers in a batch. 2022-03-17 12:46:33 -07:00
MockSSKEnvironment.m Fetch phone numbers in a batch. 2022-03-17 12:46:33 -07:00
MockSubscriptionManager.swift Don't show subscription megaphone again until your subscription has been expired for at least 2 weeks 2022-02-11 13:09:20 -08:00
NoopNotificationsManager.swift Elaborate logging around missing notifications. 2021-09-02 22:51:26 -03:00
NoopPendingReadReceiptRecorder.swift Add support for viewed receipts 2021-04-29 18:01:18 -07:00
OWSFakeCallMessageHandler.h Respond to CR. 2021-10-21 09:21:31 -03:00
OWSFakeCallMessageHandler.m Lint 2022-03-04 14:16:29 -08:00
OWSFakeMessageSender.h Respond to CR. 2021-10-21 09:21:31 -03:00
OWSFakeMessageSender.m Apply script to normalize includes and imports. 2021-10-21 09:21:10 -03:00
OWSFakeProfileManager.h Fetch phone numbers in a batch. 2022-03-17 12:46:33 -07:00
OWSFakeProfileManager.m Fetch phone numbers in a batch. 2022-03-17 12:46:33 -07:00
OWSMockSyncManager.swift [Badging] Signal devices when subscription status changes 2021-12-02 21:04:47 -10:00
TestAppContext.h Respond to CR. 2021-10-21 09:21:31 -03:00
TestAppContext.m Do not use -[UIApplication setStatusBarHidden:animated:]. 2022-01-31 15:15:18 -08:00
TestKeychainStorage.swift Fix a couple test breakages 2021-06-02 19:03:25 -07:00
TestProtocolRunner.swift Support two SignalProtocolStores in SSKEnvironment 2022-03-16 14:31:06 -07:00