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. |
||
|---|---|---|
| .. | ||
| AppSetup.h | ||
| AppSetup.m | ||
| Environment.h | ||
| Environment.m | ||
| LaunchJobs.swift | ||
| MessageRequestPendingReceipts.swift | ||
| NoopCallMessageHandler.swift | ||
| OWSSounds.h | ||
| OWSSounds.m | ||
| VersionMigrations.h | ||
| VersionMigrations.m | ||