Commit Graph

4710 Commits

Author SHA1 Message Date
Michelle Linington
a967bb12bc PR Feedback:
- Matthew suggested moving all polite readiness blocks to their
  impolite variants. There shouldn't be ordering concerns and message
  processing is important enough to be run impolitely.

- Nora suggested moving some of the message processing checks into
  MessagePipelineSupervisor. Some of the more complex checks like
  registration are out of scope of this change. But -[AppContext
  shouldProcessIncomingMessages] is a minor enough change to include.
  Now, -shouldProcessIncomingMessages is a precondition for
  -isMessageProcessingPermitted

- Matthew suggested that GRDB failures should be fatal. So instead,
  AnySignalRecipientFinder will try! instead of try?.

- Matthew suggested moving some of the MessagePipelineSupervisor
  logging statements to be lower priority.
2020-07-22 21:10:27 -07:00
Michelle Linington
95575ca19b Adds a whole bunch of tests for MessagePipelineSupervisor
- Adopt a local dependency property to fit in with existing style
- Unregister from pipeline supervision in some pipeline stages. This
  usually shouldn't matter since they're all singletons/children of
  singletons. I've only added this to classes that are already
  unregistering existing observations, or don't have any existing
  observations. Anything that was registering and not unregistering,
  I've left as is.
2020-07-22 21:10:27 -07:00
Michelle Linington
e3e903a8ad IOS-631: Suppress message processing pipeline while we have a pending backfill operation
Creates a new root singleton: OWSMessagePipelineSupervisor

As of right now, this singleton has two responsibilities:
- Track all message processing pipeline stages that have registered
  themselves
- Post processing suspension updates to interested stages

Four classes will now register themselves as pipeline stages:
- OWSMessageContentQueue
- YAPDBMessageDecryptQueue
- IncomingGroupsV2MessageQueue
- SSKMessageDecryptJobQueue

At initialization, OWSMessagePipelineSupervisor will take out a pipeline
suspension while it waits for a UUIDBackfillTask to complete. Other
interested objects are also able to suspend the message processing
pipeline by invoking suspendMessageProcessing(for:) on the supervisor
(though, currently this is not used by anything except tests)

This also adds some supporting improvements to UnfairLock. Now,
UnfairLock closures will return the value returned from its critical
section closure.
2020-07-22 21:10:27 -07:00
Nora Trapp
f2d96d02ec Maintain unknown fields when updating storage records 2020-07-22 14:43:24 -07:00
Nora Trapp
c5214e38b6 Add Codable adherance to proto wrappers 2020-07-22 14:34:24 -07:00
Nora Trapp
c4111f59d0 Generate interface for unknownFields 2020-07-22 14:34:24 -07:00
Nora Trapp
ee9a56dc4b Clean up orphaned accounts from storage service 2020-07-22 14:33:07 -07:00
Matthew Chen
153dffac23 Allow debug and internal builds to use gv2 without CDS. 2020-07-22 13:28:57 -03:00
Matthew Chen
9db8e72d52 Re-apply current revision when updating v2 groups in some cases. 2020-07-22 13:05:38 -03:00
Matthew Chen
639c6a17ee Add remote config for modern CDS and groups v2. 2020-07-22 13:04:33 -03:00
Matthew Chen
c14cc341c4 Add remote config for modern CDS and groups v2. 2020-07-22 13:04:33 -03:00
Matthew Chen
269309de01 Add remote config for modern CDS and groups v2. 2020-07-22 13:04:33 -03:00
Matthew Chen
597486f54a Add MVP legacy group indicator. 2020-07-22 11:49:59 -03:00
Nora Trapp
30e89998da Merge branch 'release/3.13.2' 2020-07-19 15:00:54 -07:00
Nora Trapp
7e0eeb07b1 Feature flags for .qa. 2020-07-17 12:55:10 -07:00
Nora Trapp
b0de119e6d Feature flags for .production. 2020-07-17 12:55:03 -07:00
Nora Trapp
f2fd6d9fcc Feature flags for .qa. 2020-07-17 12:04:25 -07:00
Nora Trapp
acdfa06dbe Feature flags for .production. 2020-07-17 11:58:21 -07:00
Nora Trapp
cbb7504abd Fix rare crash when rendering profile name changes 2020-07-17 11:58:12 -07:00
Nora Trapp
ba994e67af Feature flags for .qa. 2020-07-16 16:49:08 -07:00
Nora Trapp
2f0cee3de3 Feature flags for .production. 2020-07-16 16:48:45 -07:00
Michelle Linington
d396f99a16 IOS-662: Update staging enclave ID
The staging enclave code was updated to support rate-limiting. Updates
our staging constant to point to the new ID.
2020-07-16 14:54:02 -07:00
Nora Trapp
2400c680c1 Feature flags for .qa. 2020-07-15 20:18:39 -07:00
Nora Trapp
6dfc1d04dd Merge branch 'release/3.13.2' 2020-07-15 19:25:39 -07:00
Nora Trapp
5a45c46497 Feature flags for .production. 2020-07-15 19:21:43 -07:00
Nora Trapp
b6e365481f Feature flags for .qa. 2020-07-15 19:21:43 -07:00
Nora Trapp
5ee337277b Feature flags for .production. 2020-07-15 19:21:43 -07:00
Nora Trapp
463e0266a4 PR Feedback 2020-07-15 18:41:29 -07:00
Nora Trapp
c7eb281d38 Render profile name changes in conversation 2020-07-15 18:41:14 -07:00
Nora Trapp
0460d9cdea PR Feedback 2020-07-15 11:32:20 -07:00
Nora Trapp
719213e8d9 Render profile name changes in conversation 2020-07-14 19:18:28 -07:00
Nora Trapp
d745cb135a Merge branch 'release/3.13.1' 2020-07-14 15:51:45 -07:00
Michelle Linington
5d2267cb15 Invert the modern CDS FeatureFlag check
Accidentally inverted the condition when I swapped the flags. Thanks
Nora for catching this
2020-07-13 19:22:04 -07:00
Michelle Linington
2d1b90f443 Pull request feedback: retry indefinitely on CDS failure
After some discussion, we're okay considering that if CDS is down, all
of Signal is down. This will help protect session state and reduce the
risk of divergence.

Also changed the FeatureFlag guarding this code to
useOnlyModernContactDiscovery.
2020-07-13 18:20:47 -07:00
Michelle Linington
16583ceafa Additional review feedback:
- Removed static UUIDBackfillTask initializer and removed the
  registration from AppDelegate. Kicking off the task will be handled
  with IOS-631.
- Moved the async perform work to its own function
- Some minor syntactic changes
- Updated database fetch to retrieve empty string UUIDs
- Handles non-e164 numbers fetched from database
- Leverages the MockSSKEnvironment to deal with the shared
  SignalServiceAddressCache. Removes added test support.
- Add tests to exercise new functionality
2020-07-13 18:20:47 -07:00
Michelle Linington
ddb2467ebf Added tests to exercise UUIDBackfillTask
This adds a whole bunch of tests for UUIDBackfillTask. This required a
small change to be made in SignalServiceAddress. Currently,
SignalServiceAddress accesses a singleton cache to force updates to any
existing addresses after a UUID is discovered. This breaks a whole bunch
of test verification.

To workaround this, I've added a testing_ flag to modify the singleton
SignalServiceAddressCache to temporarily disable it. This is going to
cause problems if we ever enable test parallelization, but it's all we
can do for now.

This also adds in incremental backoff logic, changes some of the log
statements and disables the task on production.

Also, adopted some minor feedback Matthew provided in the draft PR,
including:
- Rename: {signal -> registered}RecipientsWithoutUUID
- Move to owsFailDebug instead of assertionFailure
- Adopt `IsNetworkConnectivityFailure` for discerning network failures
- Add some extra assertions around our registered/unregistered sets
2020-07-13 18:20:47 -07:00
Michelle Linington
821f7cfb65 IOS-441: On launch: Perform CDS lookup to backfill SignalRecipients without UUID
Introduces UUIDBackfillTask, which:
- fetches UUID-less SignalRecipients from the database
- creates a ContactDiscoveryOperation to lookup their UUIDs
- updates database with the UUID if available, unregisters otherwise

This is kicked off on an AppReadiness block submitted during
appDidFinishLaunching:
2020-07-13 18:20:47 -07:00
Nora Trapp
3e0c6f6dcc Feature flags for .qa. 2020-07-13 14:54:39 -07:00
Nora Trapp
b59ec0c8a9 Feature flags for .production. 2020-07-13 14:54:39 -07:00
Nora Trapp
1ba39eb743 Fix an issue during re-registration where we were clearing the 'hasPendingRestoration' flag too early. 2020-07-13 14:35:06 -07:00
Matthew Chen
21aae06e60 Respond to CR. 2020-07-13 10:42:43 -03:00
Matthew Chen
ebce97faf8 Respond to CR. 2020-07-13 10:42:43 -03:00
Matthew Chen
b9fbb3da82 Evacuate model caches after device transfer. 2020-07-13 10:42:43 -03:00
Matthew Chen
91028f9021 Respond to CR. 2020-07-13 10:41:37 -03:00
Matthew Chen
b5925c8f6f Filter more display names. 2020-07-13 10:41:37 -03:00
Nora Trapp
48a990c03c Merge branch 'release/3.13.0' 2020-07-10 18:49:53 -07:00
Nora Trapp
c92b1768c4 Feature flags for .qa. 2020-07-10 18:47:36 -07:00
Nora Trapp
bb170fbb8c Feature flags for .production. 2020-07-10 18:47:14 -07:00
Nora Trapp
272c1a7cbc Simplify 2FA logic, update copy 2020-07-10 17:04:36 -07:00
Nora Trapp
df8122da09 Cleanup KBS state management 2020-07-10 09:12:56 -07:00