Signal-iOS/SignalServiceKit/tests/Storage
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
..
InteractionFinderTest.swift Remove YapDatabase. 2021-03-25 11:41:16 -03:00
ModelReadCacheTest.swift Fetch phone numbers in a batch. 2022-03-17 12:46:33 -07:00
OWSIdentityManagerTests.m Teach OWSIdentityManager about PNI identity keys 2022-03-16 13:29:20 -07:00
SDSDatabaseStorageObservationTest.swift Remove databaseChangesWillUpdate. 2021-09-08 21:41:13 -03:00
SDSDatabaseStorageTest.swift Rework dependency access. 2021-03-25 09:24:27 -03:00
SDSKeyValueStoreTest.swift YDB-to-GRDB migration stress testing. 2019-09-16 13:34:55 -03:00
SSKPreKeyStoreTests.m Parameterize the 1:1 stores by identity (ACI or PNI) 2022-03-16 14:31:06 -07:00
SSKSignedPreKeyStoreTest.swift Parameterize the 1:1 stores by identity (ACI or PNI) 2022-03-16 14:31:06 -07:00
TestModelTests.swift Remove YapDatabase. 2021-03-25 11:41:16 -03:00