Commit Graph

489 Commits

Author SHA1 Message Date
Nora Trapp
db115606e3 Remove ZKGroup 2022-01-03 12:00:19 -08:00
Nora Trapp
9ed5e74b79 Sync additional badge info with storage service 2021-12-17 13:54:20 -08:00
Nora Trapp
64b399f3e3 Fix badge expiry 2021-12-17 13:54:20 -08:00
Michelle Linington
3d695404ab VisibleBadgeIds is now nonnull on PendingProfileUpdate
A nil array would clear badges anyway. This makes things a bit more
explicit. Also improves some logging.
2021-12-06 12:06:19 -08:00
Michelle Linington
445d30524f Fixes a typo in PendingProfileUpdate decoding 2021-12-06 12:06:19 -08:00
Matthew Chen
55b5474caa Schedule storage backup. 2021-11-19 08:40:32 -03:00
Nora Trapp
18a7ad8b2c Fix badge visibility on acquisition 2021-11-17 16:05:58 -08:00
Matthew Chen
34be144a78 Improve profile handling. 2021-11-17 14:49:47 -03:00
Michelle Linington
94c05bad09 Actually persist badge settings
- Augment profile settings to actually record the user's badge
  preferences
- Save these changes to the profile endpoint
2021-11-16 09:55:58 -08:00
Eugene Bistolas
78cb9352c3 [Badging] Durable receiptCredential fetch and redemption 2021-11-15 12:47:35 -10:00
Matthew Chen
98caa0bdfa Fix comment. 2021-11-13 17:08:35 -03:00
Matthew Chen
62782800b3 Fix race in profile re-upload. 2021-11-13 17:08:35 -03:00
Matthew Chen
7e25e4003a Improved logging around dropped profile avatars. 2021-11-12 09:41:27 -03:00
Matthew Chen
48677fb78f Improved logging around dropped profile avatars. 2021-11-12 09:41:27 -03:00
Michelle Linington
cc4f5fe9d4 PR Feedback:
- Consistent use of ConversationStyle
- LocalUserDisplayMode is now a required initializer argument

Also a small bug fix around avatar file path URLs
2021-11-09 14:25:55 -08:00
Michelle Linington
bd51ca690a Replace AvatarImageView2 with ConversationAvatarView2
Adoption of ConversationAvatarView2 in many key locations. This isn't
exhaustive, but it's mostly there.

Some work left to be done around ConversationAvatarView2 data source
tweaks.
2021-11-09 14:25:55 -08:00
Michelle Linington
9123bbd0b4 Partial progress on badged avatars 2021-11-09 14:25:55 -08:00
Michelle Linington
660a1f80aa PR Feedback 2021-11-09 14:25:55 -08:00
Michelle Linington
ff3d21ff0e Minor tweaks to recent badging changes
- Optionals are now SDSSwiftSerializable as long as their wrapped type
  conforms
- Avatar file writes are now performed outside of a write transaction
- Various rebase cleanup
2021-11-09 14:25:53 -08:00
Michelle Linington
ebadb12dad Minor comment tweaks, schema adjustments 2021-11-09 14:25:42 -08:00
Michelle Linington
a6deb98c42 Lint 2021-11-09 14:25:42 -08:00
Michelle Linington
5f6ee31e68 Most of badge fetching and persistence
Saving progress before running database codegen
2021-11-09 14:25:42 -08:00
Matthew Chen
539dff09e4 Move MobileCoin SDK to SignalUI. 2021-11-02 14:26:03 -03:00
Matthew Chen
04970414e7 Move MobileCoin SDK to SignalUI. 2021-11-02 14:26:03 -03:00
Matthew Chen
093e814b79 Reduce statics. 2021-11-02 10:36:25 -03:00
Matthew Chen
c301a56565 Reduce async work done on NSE launch. 2021-10-21 08:53:15 -03:00
Matthew Chen
1b655d63f5 Reduce async work done on NSE launch. 2021-10-21 08:53:15 -03:00
Matthew Chen
21a8175795 Add SignalUI framework target. 2021-10-19 09:39:53 -03:00
Matthew Chen
c416609108 Add SignalUI framework target. 2021-10-19 09:39:53 -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
Michelle Linington
bcb7eddb63 Fix issue with data migrations after a schema change
We're seeing crashes during this data migration step. We fail to init
the OWSUserProfile from the Row result returned from the SQLite fetch
request. It's likely we're indexing into an out-of-bounds index on Row.
(Row._checkIndex is inlined so we can't be sure)

GRDB caches the sqlite3_column_count during Row.init and uses that to
determine if a subscript access is out-of-bounds. From what I can tell
in an amateur reading of sqlite3.c, that just pulls the nResColumn from
the prepared statement. SQLite will determine the number of result
columns during statement prep, but the column count can change if the
table schema changes:

> If the database schema changes, instead of returning SQLITE_SCHEMA as
  it always used to do, sqlite3_step() will automatically recompile the
  SQL statement and try to run it again. As many as
  SQLITE_MAX_SCHEMA_RETRY retries will occur before sqlite3_step() gives
  up and returns an error.

We're nesting a deferred read transaction inside of our data migration's
immediate transaction. This read is using a different sqlite connection
that the connection performing our migrations. So its understanding of
the schema is stale and because it's in a deferred transaction it won't
figure this out until we call _step().

Once we call _step(), sqlite will realize that the table schema has
changed and recompile the prepared statement while opening the
deferred transaction. After this, the sqlite_column_count is correct.
But Row still has the incorrect value cached from before the schema was
resolved.

So by the time we try and init our OWSUserProfile, Row falsely asserts
that we're indexing beyond the column count by comparing against a stale
version of the column count.

The fix:
Rework the data migration to avoid nesting a deferred read transaction.
This is incorrect behavior. Now that our read is using our already open
write transaction with the same connection handle, it's understanding of
the schema is up-to-date during statement prep. So Row.init grabs the
current column count.
2021-09-30 13:00:26 -07:00
Matthew Chen
b058317777 Assert that GRDB schema/data migrations are complete before we warm caches. 2021-09-23 10:15:34 -03:00
Matthew Chen
0ca1ac29f5 Fix "no session for transient message" errors. 2021-09-08 09:53:46 -03:00
Nora Trapp
2814ab7629 Convert to new Promise library 2021-09-03 11:41:34 -07:00
Matthew Chen
59512bbdf2 Fill in missing profile avatars. 2021-09-01 10:46:17 -03:00
Matthew Chen
647f723610 Add OWSStaticOutgoingMessage. 2021-08-25 22:43:42 -03:00
Eugene Bistolas
e1c43e3583 Additional logging for prod NSE avatar generation 2021-08-25 14:24:19 -10:00
Matthew Chen
b5153947fd Elaborate local profile avatar logging. 2021-08-19 14:45:43 -03:00
Matthew Chen
b28131de13 Refine error localizedDescription. 2021-08-18 15:01:03 -03:00
Matthew Chen
e7ac736f7d Clean up ahead of PR. 2021-08-18 14:26:19 -03:00
Matthew Chen
36a090e319 Clean up ahead of PR. 2021-08-18 14:25:38 -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
Matthew Chen
ba20b729e1 Fix over-zealous assert in sticker manager. 2021-08-16 09:53:15 -03:00
Matthew Chen
0023e9a432 Rework blocking manager. 2021-07-21 16:38:36 -07:00
Matthew Chen
6e2c6ff575 Rework blocking manager. 2021-07-21 16:37:59 -07:00
Matthew Chen
fad5d66bbb Rework blocking manager. 2021-07-21 16:37:59 -07:00
Matthew Chen
73adf6a5d7 Improve logging around local profile avatar. 2021-07-13 16:50:53 -03:00
Matthew Chen
6ba8c14be7 Remove profile manager caches. 2021-06-21 17:47:44 -03:00
Matthew Chen
968898d3d1 Respond to CR. 2021-06-18 14:02:30 -03:00