Commit Graph

337 Commits

Author SHA1 Message Date
Matthew Chen
2e126d2fae Merge remote-tracking branch 'private/release/3.15.0' 2020-08-20 16:35:40 -03:00
Matthew Chen
40830ee7b0 Add test around URL composition. 2020-08-20 15:40:34 -03:00
Matthew Chen
351cbba766 Merge remote-tracking branch 'private/release/3.15.0' 2020-08-20 09:33:41 -03:00
Matthew Chen
38043183e6 Cautious proto address parsing. 2020-08-19 17:06:13 -03:00
Matthew Chen
3942ff7fb2 Cautious proto address parsing. 2020-08-19 13:24:16 -03:00
Matthew Chen
7c047d5798 Minor cleanup. 2020-08-19 10:51:57 -03:00
Matthew Chen
85929d083a Revisit resumable attachment uploads. 2020-08-19 10:44:47 -03:00
Michelle Linington
5da0078bbe Run precommit script 2020-08-13 15:08:12 -07:00
Michelle Linington
cd26048e43 Add tests for ContactDiscoveryTask.RateLimiter 2020-08-13 15:08:12 -07:00
Michelle Linington
18ce525c2e Add some tests to exercise date parsing
Date+SSKTest has a suite of tests that checks parsing of HTTP and
IOS8601 dates directly

NSURLSessionDataTask+OWS_HTTPTest validates that the Retry-After parsing
of NSHTTPURLResponse works as expected

Also, this change renames the NSURLSessionDataTask extension header to
something more generally appropriate
2020-08-13 14:40:22 -07:00
Matthew Chen
fdd3c513ca Rework Groups v2 & CDS feature flags. 2020-08-11 17:45:04 -03:00
Matthew Chen
e2c2f37e60 Respond to CR. 2020-08-11 17:25:47 -03:00
Matthew Chen
b85cc48017 Add unit test around address mapping changes. 2020-08-11 16:44:32 -03:00
Matthew Chen
9e62160abe Fix perf problems around observation of addressing mapping changes. 2020-08-11 16:44:32 -03:00
Michelle Linington
3f746368cd PR feedback:
- Adjust how clients provide QoS information to ContactDiscoveryTask
- Fix an issue where legacy CDS was reporting a generic server failure
  as a result of network failures.
- ContactDiscoveryTask will no longer error on an empty set
- Remove CDSFeedback operation
2020-08-06 12:57:39 -07:00
Michelle Linington
a660a81d0f IOS-668: Reorganize how ContactsUpdater interacts with CDS operations
- Removes ContactsUpdater singleton. It wasn't really tracking much
  state anyway
- Introduces ContactDiscoveryTask. This creates a
  ContactDiscoveryOperation (modern or legacy) and updates the
  SignalRecipients database on completion. Returns a promise.
- Begin migrating away from operation queues

PromiseKit is weird about priority propogation, so this shouldn't be
used yet. Since all then closures are asynced, priorities don't
propogate down to underlying queues. This means the a
ContactDiscoveryTask on the main queue will not boost the priority on
the ModernContactDiscoverOperation's owned operation queue
2020-08-06 12:55:32 -07:00
Nora Trapp
9696671f8a Add trustLevel to SignalServiceAddress 2020-08-05 14:36:43 -07:00
Michelle Linington
4a6fdf261e IOS-705: Adjust feature flags to enable modern CDS in prod
This enables modern CDS on internal devices in prod. This also removes
some of the infrastructure for reporting on modern/legacy comparisons.
2020-08-04 15:49:12 -07:00
Nora Trapp
d536c8ded0 PR Feedback 2020-07-24 13:15:32 -07:00
Nora Trapp
dde6f0bc59 Add tests around uuid <-> phone number mapping changes 2020-07-24 13:15:32 -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
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
Nora Trapp
272c1a7cbc Simplify 2FA logic, update copy 2020-07-10 17:04:36 -07:00
Michelle Linington
5c7e82bbe3 Adopt changes from precommit linting scripts 2020-07-06 13:48:59 -07:00
Michelle Linington
5b0656060e IOS-641: Introduce various synchronization utilities
This commit adds two new synchronization utilities:

- Unfair locks: This adds an Objective-C wrapper around os_unfair_lock
  to help bridge it to Swift. (Swift's handling of the underlying C
  struct can lead to surprising TSan failures). This will be useful as a
  simple, performant lock in cases where fairness is not a concern.

- Shared serial queues: Private serial queues that are untargeted will
  target the global concurrent queues. Sometimes this is what we want,
  especially for potentially long-running work items. But for cases
  where work items are brief private serial queues risk spinning up a
  new thread.

  For private queues where the individual work items are brief and there
  isn't a more appropriate queue to target, the shared serial queues
  are a potential candidate.

This change also introduces tests for these new utilities and some QoS
management helper methods.
2020-07-06 13:48:59 -07:00
Matthew Chen
154805cf68 Fix broken tests. 2020-06-23 10:04:39 -03:00
Matthew Chen
3cedd3ccdf Overhaul database observation. 2020-06-18 09:28:49 -03:00
Matthew Chen
7298549e98 Resolve issues related to groups v2 in test suites. 2020-06-04 09:40:38 -03:00
Nora Trapp
22f7298654 Fix tests 2020-06-01 13:07:56 -07:00
Nora Trapp
57a810658a Goodbye iOS 10 2020-05-27 17:34:32 -07:00
Matthew Chen
6b4f192b1b Remove usage of retainUntilComplete. 2020-05-22 09:51:12 -03:00
Matthew Chen
8f468dce67 Respond to CR. 2020-05-11 10:29:13 -03:00
Matthew Chen
f8b9b209ff Respond to CR. 2020-05-11 10:19:52 -03:00
Matthew Chen
255cfe1cfd Add TSIncomingMessageBuilder. 2020-05-11 09:28:13 -03:00
Matthew Chen
c2cb189e16 Add TSIncomingMessageBuilder. 2020-05-11 09:28:13 -03:00
Matthew Chen
fad9510dbe Add TSIncomingMessageBuilder. 2020-05-11 09:28:13 -03:00
Matthew Chen
553fca16f6 Merge branch 'release/3.8.4' 2020-05-08 16:13:17 -03:00
Nora Trapp
a590bda73d Always use UUID capable sender certificate 2020-05-07 14:15:16 -07:00
Nora Trapp
f0d7a9cb9c Add early message handling for delivery receipts, reactions, and delete for everyone 2020-04-16 19:44:45 -07:00
Matthew Chen
7246c613d5 Fix more build warnings. 2020-04-10 13:17:08 -03:00
Ehren Kret
4738201be1 Add CDN key and number to AttachmentPointer proto message 2020-04-09 12:47:23 -07:00
Matthew Chen
dd42dcca49 Remove YDB from views. 2020-04-07 13:51:02 -03:00
Nora Trapp
7bb6e42be3 Merge branch 'release/3.7.0' 2020-03-25 22:31:11 -07:00
Nora Trapp
6683c09f81 Disable link preview randomly failing tests 2020-03-25 22:30:22 -07:00
Nora Trapp
f7f21ddb79 Use test board for pinterest tests 2020-03-24 17:11:02 -07:00
Nora Trapp
2e6612525a Fix broken tests 2020-03-24 17:11:02 -07:00
Matthew Chen
9276ca7670 Make flaky pinterest link test more permissive. 2020-03-21 22:59:18 -03:00