Commit Graph

325 Commits

Author SHA1 Message Date
Jordan Rose
904bb36d7f Turn group data caches back on in the NSE
Without the GroupV2Params caches, processing multiple large group
updates is extremely wasteful, decrypting the same profile keys and
UUIDs over and over again. The size of these caches has also been
*increased* to match the group size limit, or else there's no benefit
for large groups.

Other LRUCache instances are still off by default in the NSE by virtue
of the "NSE max" defaulting to 0.
2022-01-20 16:49:37 -08:00
Jordan Rose
0edd86f3f7 Improve cache keys for group member profiles, UUIDs, and blobs
When Data is put into an NSCache it gets converted to an NSData, which
is a CFData underneath. CFData's hash function only looks at a prefix
of the data, and the secret params were taking up a good chunk of that
prefix, leading to hash collisions. By putting more variable data
first, we get better hashes *and* exit memcmp faster in the case of a
collision.
2022-01-20 16:08:34 -08:00
Jordan Rose
58a688ad61 Lazily deserialize individual group changes
If there are several group changes being returned at once,
deserializing all of them up front can lead to excessive memory use,
especially for very large groups. This commit switches to
deserializing each change as it is used, which doubles the amount of
CPU work (because we loop through the changes twice) in exchange for
only ever having one Change object graph in memory at a time. It does
also mean we can get a protobuf deserialization error a bit later in
the process if the data is ever corrupted, but that shouldn't cause
additional issues at these particular call sites.
2022-01-20 12:00:50 -08:00
Nora Trapp
db115606e3 Remove ZKGroup 2022-01-03 12:00:19 -08:00
Matthew Chen
cfb5db5812 Discard profile key credentials and temporal credentials when we re-register. 2021-11-19 14:28:27 -03:00
Matthew Chen
6009408e83 Improve profile handling. 2021-11-17 14:49:47 -03:00
Eugene Bistolas
64f126ae3f [Badging] Badge receipt credential fetch and redemption 2021-11-09 14:26:05 -08:00
Michelle Linington
77b7ea5c40 Fix a whole bunch of warnings 2021-10-21 21:11:26 -07:00
Matthew Chen
1b655d63f5 Reduce async work done on NSE launch. 2021-10-21 08:53:15 -03:00
Matthew Chen
f9b0b32720 Clean up HTTP error metadata accessors. 2021-10-15 11:52:31 -03:00
Matthew Chen
d402636225 Simplify AFNetworking usage. 2021-10-15 10:50:35 -03:00
Nora Trapp
2814ab7629 Convert to new Promise library 2021-09-03 11:41:34 -07:00
Matthew Chen
6c30515c00 Fix over-zealous asserts. 2021-08-26 14:53:24 -03:00
Matthew Chen
647f723610 Add OWSStaticOutgoingMessage. 2021-08-25 22:43:42 -03:00
Matthew Chen
c184139478 Clean up remote config and feature flags. 2021-08-24 20:39:26 -03:00
Matthew Chen
4682248117 Clean up ahead of PR. 2021-08-18 14:26:18 -03:00
Matthew Chen
67d9eeab5b Clean up ahead of PR. 2021-08-18 14:26:18 -03:00
Matthew Chen
89d8f92fbb Clean up ahead of PR. 2021-08-18 14:25:39 -03:00
Matthew Chen
6b7aafd6fd Clean up ahead of PR. 2021-08-18 14:25:39 -03:00
Matthew Chen
fcdca12cf5 Deprecate REST, Part 1
* Port socket manager to Swift.
* Clean up HTTP request success/failure state & errors.
* Rework network manager.
* Rework HTTP errors.
* Rework errors "properties": isRetryable, etc.
* Fix test breakage.
2021-08-18 14:25:36 -03:00
Nora Trapp
1cbe9c3ee7 PR Feedback 2021-08-16 13:28:08 -07:00
Nora Trapp
65ff51acb4 Send all messages via MessageSenderJobQueue 2021-08-16 13:27:43 -07:00
Matthew Chen
c9c9c96d0b Fix layout in gallery detail view. 2021-08-11 10:37:43 -03:00
Michelle Linington
51f3a58a61 Message send log recording and resend responses 2021-07-21 22:58:51 -07:00
Michelle Linington
6a0bfa7836 Make SignalServiceAddress optional for message building
SenderKey requires that building a message is agnostic from a single
recipient. This makes the recipient argument when building an outgoing
message optional.

Currently this is used to determine if a profile key should be appended
to the message. A different solution will be required for SenderKey
messages.
2021-07-21 22:58:50 -07:00
Matthew Chen
c3ec68b9d0 Respond to CR. 2021-07-21 16:50:50 -07:00
Matthew Chen
428f8a7605 Refresh groups on launch. 2021-07-21 16:50:50 -07:00
Matthew Chen
4986b8e439 Fix conflict when updating group profile keys vs. local user not in group. 2021-07-21 16:48:09 -07:00
Matthew Chen
33fc258c0a Respond to CR. 2021-07-13 15:28:29 -03:00
Matthew Chen
f49e941474 Announcement-only groups. 2021-07-13 11:42:52 -03:00
Matthew Chen
84ce81bc3c Announcement-only groups. 2021-07-13 11:42:52 -03:00
Matthew Chen
9306f94b77 Announcement-only groups. 2021-07-13 11:42:52 -03:00
Matthew Chen
3886973c02 Update groups after unblocking them. 2021-07-09 22:31:04 -03:00
Matthew Chen
ef0098523f Improve blocking of v2 groups. 2021-07-09 22:31:04 -03:00
Matthew Chen
666cd8fab3 Make reachability thread-safe. 2021-07-07 09:49:45 -03:00
Matthew Chen
3f07db9e37 Clean up async completions. 2021-07-07 09:49:44 -03:00
Matthew Chen
94ef153b84 Evacuate some LRUCaches when app enters the background. 2021-07-01 09:53:03 -03:00
Matthew Chen
2df3b2120c Apply LRU cache to group v2 updates throttling. 2021-06-30 16:11:55 -03:00
Matthew Chen
fc78bc6d06 Apply LRUCache everywhere. 2021-06-30 16:01:08 -03:00
Matthew Chen
b9bc35e74b Apply LRUCache everywhere. 2021-06-30 16:01:08 -03:00
Matthew Chen
82aab5ea12 Apply count limits to all NSCache, clean up caching. 2021-06-23 09:39:43 -03:00
Matthew Chen
50c3b2fa7b Allow user to reset device data when re-linking to a new primary with a different phone number or uuid. 2021-05-25 17:41:56 -03:00
Nora Trapp
1e40ec144d Add support for group descriptions 2021-05-17 09:58:35 -03:00
Nora Trapp
a0d542657b Streaming encryption and decryption of attachments 2021-04-08 13:30:36 -07:00
Matthew Chen
235eb5d119 Payments changes in SignalMessaging. 2021-04-06 13:57:07 -03:00
Matthew Chen
e552062be8 Refine error handling in group profile fetching. 2021-04-05 16:22:26 -03:00
Matthew Chen
6ecd2c2299 Merge branch 'release/5.8.1' 2021-03-31 00:10:49 -03:00
Nora Trapp
5b66cc4a7a Fix groups v2 bug 2021-03-30 23:12:36 -03:00
Matthew Chen
7270771927 Ensure local profile key credentials are updated in lockstep with local profile key. 2021-03-25 16:35:21 -03:00
Matthew Chen
d0cbf8cfd0 Rework dependency access. 2021-03-25 09:24:27 -03:00