Commit Graph

392 Commits

Author SHA1 Message Date
Fumiaki Yoshimatsu
5a899b02b1 Fixes tests by giving a semi-bogus phone number to work around an assertion. 2020-08-28 09:43:54 -07:00
Fumiaki Yoshimatsu
b62f94c924 Fixes a test by giving a semi-bogus phone number to work around an assertion. 2020-08-28 09:43:54 -07:00
Fumiaki Yoshimatsu
93e5503b87 Fixed two tests related to UIDatabaseSnapshotDelegate. 2020-08-28 09:42:45 -07:00
Matthew Chen
f243889d00 Use protocol contexts in prekey stores. 2020-08-25 21:31:56 -03:00
Matthew Chen
4c6f2c22b4 Use protocol contexts in prekey stores. 2020-08-25 21:31:56 -03:00
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
Nora Trapp
5c976b0acd PR Feedback 2020-03-16 16:30:58 -07:00
Nora Trapp
72842e094d Disable some tests temporarily 2020-03-14 15:40:02 -07:00
Nora Trapp
78c5c19def fix some tests 2020-03-14 10:43:56 -07:00
Matthew Chen
20aeb8df44 Merge remote-tracking branch 'private/release/3.6.0' 2020-03-02 13:39:20 -03:00
Matthew Chen
529dbf09cd Fix unit tests. 2020-02-28 16:30:54 -03:00
Matthew Chen
81638f8b88 Fix unit tests. 2020-02-28 16:30:54 -03:00
Matthew Chen
e216b5a615 Integrate group updates and disappearing message configuration updates. 2020-02-21 13:05:20 -03:00
Michael Kirk
f198d9037d Merge tag '3.5.0.5' 2020-02-19 19:26:05 -07:00
Michael Kirk
f406de7797 plumb through messageRequest circumstance when marking as read 2020-02-16 13:13:12 -07:00
Nora Trapp
79d4b8e33a Storage Service Encryption Finalization 2020-02-11 13:29:02 -08:00
Michael Kirk
d024ed99c0 Use appropriate sender certificate depending on capabilities 2020-01-31 20:33:57 -07:00
Matthew Chen
2734f01dcd Merge tag '3.3.0.5' 2020-01-27 12:00:09 -03:00
Matthew Chen
bc0359268e Rework outgoing messages; embed change protos in outgoing change messages for groups v2. 2020-01-27 11:47:44 -03:00
Matthew Chen
5eb2e99ded Respond to CR. 2020-01-24 17:00:50 -03:00
Matthew Chen
a40b9864a6 Improve thread safety of job queues. 2020-01-24 17:00:50 -03:00
Matthew Chen
891c0cb039 Improve thread safety of job queues. 2020-01-24 17:00:50 -03:00
Nora Trapp
7c682e1858 Additional KBS vectors and normalization fix 2020-01-23 08:56:05 -08:00
Matthew Chen
3b17c39f2e Fix tests. 2020-01-23 12:09:31 -03:00
Nora Trapp
d64d06d73b Fix test vectors for new Argon2 parameters 2020-01-22 10:06:58 -08:00
Nora Trapp
4f3993e5e2 finalize Argon2 parameters 2020-01-22 09:05:01 -08:00
Nora Trapp
51c7720b1b Allow user's to select an alphanumeric PIN 2020-01-20 18:33:48 -08:00
Nora Trapp
b7411bcb40 Implement final KBS master key encryption 2020-01-20 16:16:57 -08:00
Matthew Chen
892ce5c135 Rework message processing to handle groups v2. 2020-01-17 17:34:37 -03:00
Matthew Chen
1ae6012ecb Create and fetch groups v2; group update roundtrip. 2020-01-17 17:29:00 -03:00
Michael Kirk
9be32858d0 permissively parse legacy and modern mexican phone number formats 2020-01-16 11:41:48 -07:00
Matthew Chen
72f912dce3 Versioned profile changes, etc. 2020-01-08 13:54:54 -03:00
Nora Trapp
4d55468bd3 Merge branch 'release/3.2.0' 2020-01-02 16:50:14 -08:00
Orta Therox
469e169962 Convert to just using CocoaPods for dependencies 2020-01-02 12:03:57 -08:00
Michael Kirk
884f09ea5a Windowed conversation loading 2019-12-31 14:29:32 -08:00
Matthew Chen
f3286b755b Fix broken tests. 2019-12-11 20:41:57 -08:00
Matthew Chen
29150102cb Revert group and profile changes. 2019-12-11 20:41:54 -08:00
Matthew Chen
0f8b2ccc74 Fix broken tests. 2019-12-05 12:37:22 -03:00
Matthew Chen
05c8e674ee Rework new group new creation & group updates. 2019-12-05 12:37:22 -03:00
Matthew Chen
3d88f68cfb Rework new group new creation & group updates. 2019-12-04 15:40:54 -03:00
Matthew Chen
e46eefe50e Remove readReturningResult(). 2019-11-14 10:39:33 -03:00
Matthew Chen
9bdb85b897 Fix test broken by group manager. 2019-11-13 10:29:07 -03:00
Matthew Chen
b38a64cce8 Revert "Revert "Merge branch 'charlesmchen/groupManager2'""
This reverts commit 7530dee591.
2019-11-12 09:02:52 -03:00
Matthew Chen
7530dee591 Revert "Merge branch 'charlesmchen/groupManager2'"
This reverts commit 26fd0d0812, reversing
changes made to c17865b750.
2019-11-11 20:01:45 -03:00
Matthew Chen
fa9e49136d Apply group manager in tests. 2019-11-11 17:31:21 -03:00
Matthew Chen
0ecee32271 Apply group manager in tests. 2019-11-11 17:31:21 -03:00
Matthew Chen
b5f777d985 Fix more broken tests. 2019-11-07 17:37:48 -03:00
Matthew Chen
70d4b3a2a0 Fix broken tests. 2019-11-07 17:22:08 -03:00
Michael Kirk
61fb6e575e remove block from overwriting update, undeprecate upsert 2019-11-04 14:06:54 -08:00
Michael Kirk
0fca274e62 Sync Groups and Contacts 2019-11-04 14:06:54 -08:00
Matthew Chen
6b8708433c Delete old and unused one-time prekeys.
Thanks Mikunj Varsani for the bug report.
2019-11-02 08:16:41 -03:00