Commit Graph

27104 Commits

Author SHA1 Message Date
Jordan Rose
4f4a3f2e17 Merge branch 'jrose/upload-build-logs-on-failure' 2022-02-02 16:47:26 -08:00
Jordan Rose
5a050b914c CI: Upload build logs on failure 2022-02-02 16:06:38 -08:00
George Nachman
5b2971e79e Merge branch 'george/PR/larger-sticker-cache' into master 2022-02-02 13:07:39 -08:00
George Nachman
07d3ce2dec Increase the size of the sticker LRU cache.
We ship with 49 stickers and the previous cache size of 32 led to
thrasing every time a chat was opened.

Since sticker packs can be as large as 200 stickers and we hold three
pages in cache while the keyboard is open, increase the cache size for
the main app to 600. For the share extension, make it 64 to minimize
memory use while avoiding threashing.

The cost of this cache is just the sticker metadata (unique ID, emoji
description, etc.) so it won't make much difference in memory
utilization.
2022-02-02 13:07:01 -08:00
George Nachman
520da1e000 Merge branch 'george/PR/compare-profiles' into master 2022-02-02 09:46:15 -08:00
George Nachman
0d09397e36 Don't fetch & compare badges: badge ID is enough. 2022-02-02 09:45:30 -08:00
George Nachman
d9947bdd33 Fix diffing profiles.
When profile updates are applied, we diff them to
avoid redundant saves and the resulting work (like
reloading all cells of the conversation).

The diff often failed spuriously because
OWSUserProfileBadgeInfo did not implement
`isEqual:` and instead relied on `NSObject`'s
default implementation using pointer equality.

This commit makes two changes:

1. Implement `-[OWSUserProfileBadgeInfo isEqual:]`
2. Force the ProfileBadge to be loaded prior to
   comparing snapshots so the comparison will be
   correct.

This significantly reduces the number of database
calls when opening a large chat. It may possibly
increase the amount of DB work needed for smaller
groups by loading the profile badge earlier.
2022-02-02 09:45:30 -08:00
Nora Trapp
3fee1e3913 "Bump build to 5.28.0.13." (nightly-02-02-2022) 2022-02-02 04:00:41 -08:00
Jordan Rose
2eff5b187e Re-apply "Merge branch 'jrose/SignalServiceAddress-dedicated-lock'"
This reverts commit 3396e1ceb5.
2022-02-01 17:31:19 -08:00
Jordan Rose
19f9f6b7cd SSK: Limit the per-database-connection cache in app extensions
The default cache size for a SQLite connection is 2000KiB, but our
database pool has several reader connections plus a writer connection.
They can't share a cache because that changes SQLite's locking model,
so the next best thing is to limit their caches individually when
we're in a memory-constrained environment. To avoid the caches getting
*too* small, this also removes one of the available readers outside
the main app.
2022-02-01 16:39:25 -08:00
Jordan Rose
b3ae2d1247 Merge branch 'jrose/less-thread-reindexing' 2022-02-01 15:38:13 -08:00
Jordan Rose
38c024d1b3 Only update group member records when the group model changes 2022-02-01 15:05:34 -08:00
Jordan Rose
61232780ee Don't reindex conversations on every model change
Every single message updates a TSThread model, but only a change in a
member's profile name or phone number, or a change to a group's model,
can update the indexing information. Turn 'shouldBeIndexedForFTS' into
a tri-state 'FTSIndexMode' with options 'never', 'manualUpdates', and
'always', and use 'manualUpdates' for TSThreads. Then explicitly
reindex on any of the changes listed above.
2022-02-01 15:05:34 -08:00
Jordan Rose
be373b7ec6 Update SignalCoreKit again 2022-02-01 14:48:38 -08:00
Jordan Rose
14dab5acae Update SignalCoreKit 2022-02-01 14:48:38 -08:00
Jordan Rose
3396e1ceb5 Revert "Merge branch 'jrose/SignalServiceAddress-dedicated-lock'"
This reverts commit 73882a0e86, reversing
changes made to e6552c79ec.
2022-02-01 14:19:03 -08:00
Jordan Rose
73882a0e86 Merge branch 'jrose/SignalServiceAddress-dedicated-lock' 2022-02-01 11:38:33 -08:00
Jordan Rose
e64094e882 SSK: Manually synchronize updates to SignalServiceAddress properties
Previously this class used AtomicOptional for its properties, a
convenience wrapper we have for protecting a single value with a lock.
This wrapper trades extra heap allocations for simplicity (stepping
around Swift's prohibitions on non-atomically mutating struct
properties or relying on the addresses of object properties). However,
SignalServiceAddresses are created in sufficient numbers to make this
trade-off a problem.

This commit unboxes all of the properties on a SignalServiceAddress
and manually protects them with a shared dedicated UnfairLock.
(AtomicOptional and AtomicValue also use a shared lock, so this is no
less efficient and could actually lead to *less* contention.)
2022-02-01 11:38:21 -08:00
Jordan Rose
c8296d0e90 SSK: Funnel all SignalServiceAddress construction through one init
...including the ones for decoding, which have special, probably
redundant logic to throw away a phone number if the UUID is already
known.
2022-02-01 11:38:21 -08:00
Igor Solomennikov
e6552c79ec Fix UI delay when sending a reply in chat.
The UI updates (including adding a new message to conversation) were
being blocked for 1 second because of the animated dismissal of message
quote panel attached to the input field.
The fix is to block UI updates just for the duration of keyboard animations.
2022-02-01 11:09:09 -08:00
Michelle Linington
e6e09c83e7 Disable broken test 2022-02-01 10:23:40 -08:00
Michelle Linington
2559fa8bb4 Disable broken test 2022-02-01 10:14:51 -08:00
Michelle Linington
deade6e28b Update Pods 2022-02-01 09:31:40 -08:00
Nora Trapp
91e6ca13ef "Bump build to 5.28.0.12." (nightly-02-01-2022) 2022-02-01 04:00:38 -08:00
Igor Solomennikov
5460fff7ff Merge branch 'igor/fix-warnings' 2022-01-31 18:02:27 -08:00
Igor Solomennikov
6c037a84af Fix typo in a comment. 2022-01-31 17:57:15 -08:00
Igor Solomennikov
d1a726f467 Do not use UIVC.automaticallyAdjustsScrollViewInsets - deprecated.
Use UIScrollView.contentInsetAdjustmentBehavior instead.
2022-01-31 15:41:18 -08:00
Igor Solomennikov
71ac19adae Do not use -[UIApplication setStatusBarHidden:animated:].
Deprecated in iOS 9.
2022-01-31 15:15:18 -08:00
Igor Solomennikov
ef2f9b3937 Fix use of deprecated -[UIApplication openURL:].
Use -[UIApplication openURL:options:completionHandler:] with empty
second and third parameters.
2022-01-31 15:15:18 -08:00
Igor Solomennikov
2cbb155e34 Fix three minor compiler warnings. 2022-01-31 15:15:18 -08:00
Igor Solomennikov
ea55469ec8 Remove deprecated UITextViewDelegate methods.
textView(_:shouldInteractWith:in:) were deprecated in iOS 10.

This change is purely deletion of code because newer UITextViewDelegate
methods:  textView(_:shouldInteractWith:in:interaction:) were already
implemented.
2022-01-31 15:15:18 -08:00
Igor Solomennikov
6848210a4c Remove UIScrollView workaround that was only used in iOS 11.0-11.2
Not needed anymore since min supported iOS version is now 12.2
2022-01-31 15:15:18 -08:00
Igor Solomennikov
ec96c7a1c6 Do not use UIVC.topLayoutGuide and UIVC.bottomLayoutGuide.
Both are deprecated in iOS 12.
2022-01-31 15:15:18 -08:00
Michelle Linington
50a9186477 Merge branch 'mlin/PR/BackoffRemoteConfigFetches' 2022-01-31 13:56:55 -08:00
Michelle Linington
2a6ca73beb PR Feedback: Remove sneaky transaction annotation 2022-01-31 13:56:41 -08:00
Michelle Linington
4b6f40eaa0 Lint 2022-01-31 13:56:41 -08:00
Michelle Linington
0592b77faa Remote config fetch failures should exponentially back off 2022-01-31 13:56:41 -08:00
Martin Böttcher
5e7c4fd920 Merge branch 'martin/IOS-2130' 2022-01-31 21:05:32 +01:00
Michelle Linington
cbcb4251e4 Public initializer 2022-01-31 21:04:05 +01:00
Michelle Linington
98048d669b Removed unnecessary check for valid launch time 2022-01-31 21:04:05 +01:00
Michelle Linington
9bc1c492a5 Lint 2022-01-31 21:04:05 +01:00
Michelle Linington
8f477657c1 Fix lint script 2022-01-31 21:04:05 +01:00
Michelle Linington
e4d324fe5d Re-add log message 2022-01-31 21:04:05 +01:00
Michelle Linington
c0cddbb71d Lint 2022-01-31 21:04:05 +01:00
Michelle Linington
bae392bb4e Update Pods 2022-01-31 21:04:05 +01:00
Michelle Linington
97409f3295 Improves performance of launch jobs
Randall hit an issue where his device would take a few seconds to start
up. His logs indicate that his device is spending time running
LaunchJobs.

The first change here is to make sure we explicitly set the launch job
work at an ultra-high priority. This is okay, since we don't actually
present UI until after we finish these jobs. Running this work at
UserInteractive is appropriate since it quite literally prevents the
user from interacting with the app. There's also no other time-sensitive
UI work we need to be doing (like running animations) that we could be
contending with.

The second change is to add a bit more logging that allows us to monitor
the amount of work these jobs are doing. This will allow us to see if
these jobs are performing an excessive amount of work.

Finally, I moved these LaunchJobs to Swift. Mostly because the ObjC
implementations were block based. The additional code was going to
indent things further and our linter aggressiely indents blocks to begin
with. Moving this to Swift is much more readable.
2022-01-31 21:04:05 +01:00
Nora Trapp
e417c1c184 "Bump build to 5.28.0.11." (nightly-01-31-2022) 2022-01-31 21:04:05 +01:00
Martin Böttcher
98b86654cc small code change 2022-01-31 21:02:07 +01:00
Michelle Linington
9291f0a141 Merge branch 'mlin/PR/SlowLaunchJobs' 2022-01-31 11:00:50 -08:00
Michelle Linington
6fc0909234 Public initializer 2022-01-31 11:00:13 -08:00