Commit Graph

1309 Commits

Author SHA1 Message Date
Michael Kirk
6bfd0f29ed mark self-sent messages as read as soon as it was created 2018-09-26 09:52:34 -06:00
Michael Kirk
c0c973de1c Sort gallery finder by sortId 2018-09-26 09:52:34 -06:00
Michael Kirk
b281b37637 replace thread.lastMessageDate/archivalDate -> thread.lastSortId, thread.archivedAsOfSortId
Update migration accordingly

Date shown on home view cell is message.receivedAt
2018-09-26 09:52:34 -06:00
Michael Kirk
90aa593dcd sortId vs. Read status 2018-09-26 09:52:33 -06:00
Michael Kirk
089c4f09ea bump all views which rely on message sorting 2018-09-26 09:52:33 -06:00
Michael Kirk
ab55e85304 step 1: timestampForSorting audit, change signature
No change in functionality in this commit, I just broke the signature to have a
systematic audit of the callsites. Added TODO's with the plan for each call.
2018-09-26 09:52:33 -06:00
Michael Kirk
e1a46d85fb investigation shows we don't use this timestamp for call error messages 2018-09-26 09:52:33 -06:00
Michael Kirk
df61316495 minimize diff senderTimestamp -> timestamp 2018-09-26 09:52:33 -06:00
Michael Kirk
00d0d1e002 Remove legacy Error backdating - no changes in functionality
Historically we would backdate the SN change messages, but since adopting
non-blocking SN changes long ago, they're already sorted properly by creation
time, so backdating has been unnecessary for a while.

I also audited that all other error messages are saved directly after creation.

I applied deprecation attributes as appropriate as I audited.
2018-09-26 09:52:33 -06:00
Michael Kirk
550e7ba63b Create disappearing message update info messages before messages they affect
Since we're no longer sorting by timestamp we have to ensure we save the update
info message before we save any affected message, e.g. in the case of implicit
updates.
2018-09-26 09:52:33 -06:00
Michael Kirk
eef1368ad3 Timestamp audit step1: change signature
There is no change in functionality in this commit.

Apart from clarifying what the timestamp means (it's the timestamp of the
*sender*), this intentionally breaks all the call sites, so I could have a sane
way to thoroughly audit wherever we're passing in timestamps, to see where
we're depending on them to affect sort order.

For the sake of a cleaner diff of meaningful changes, instead of "fixing"
everything in this commit, I've just added comments and renamed signatures.
2018-09-26 09:52:33 -06:00
Michael Kirk
a60d8eb161 WIP: migration / autoincrement logic
TODO:

-[ ] contact offer
-[ ] verify all paths that utilized timestampForSorting, e.g. make sure SN appear before the message they affect, etc.
-[x] Monotonic ID
-[x] New extension which sorts by id
-[x] Migration
  -[ ] batch migration?
2018-09-26 09:52:33 -06:00
Michael Kirk
bccb633b6c fix release compile 2018-09-25 17:16:12 -06:00
Matthew Chen
98630cca50 Respond to CR; add db utility methods to test base classes. 2018-09-21 09:21:34 -04:00
Matthew Chen
559c496ae5 Clean up. 2018-09-21 09:08:39 -04:00
Matthew Chen
66fc389fba Get SSK tests building and running. 2018-09-21 09:08:39 -04:00
Matthew Chen
87836f506b Move more singletons to SSKEnvironment. 2018-09-21 09:06:48 -04:00
Matthew Chen
39ebdf0921 Log curl command for failed requests in debug builds. 2018-09-20 14:02:35 -04:00
Matthew Chen
15b52db8bf Respond to CR. 2018-09-20 08:55:19 -04:00
Matthew Chen
29bb69032a DRY up the debounce of db extension version increment. 2018-09-20 08:55:19 -04:00
Matthew Chen
e8186a7005 Fix rebase breakage. Make environment properties mutable in tests. 2018-09-19 16:30:03 -04:00
Matthew Chen
3b2c5bfc7b Modify mock environments to register all db views. 2018-09-19 16:29:15 -04:00
Matthew Chen
83e6484156 Respond to CR. Rework how OWSUploadOperation's networkManager property. 2018-09-19 16:28:03 -04:00
Matthew Chen
edcedd2845 Remove selfRecipient method. 2018-09-19 15:11:26 -04:00
Matthew Chen
e1db60c1c0 Rework creation of singletons. 2018-09-19 15:11:26 -04:00
Matthew Chen
4ad7ca79b7 Respond to CR. 2018-09-18 16:44:33 -04:00
Matthew Chen
e8eac9f30b Clean up ahead of PR. 2018-09-18 16:35:13 -04:00
Matthew Chen
b883209f91 Refine logging. 2018-09-18 16:35:12 -04:00
Matthew Chen
69290f7ec8 Improve logging around failied keychain deletion. 2018-09-18 09:07:54 -04:00
Matt Rubin
d25579e478 Treat failure to delete a non-existent password as success
Fixes https://github.com/signalapp/Signal-iOS/issues/3876
2018-09-18 09:05:43 -04:00
Michael Kirk
e1f131f09c restore save after marking item as uploaded
This was lost in an earlier fixup commit - markAsAccepted mutates but does not
persist anything since SPK doesn't know about YapDB
2018-09-17 10:10:32 -06:00
Michael Kirk
cb55ba57f5 CR: rename classes, no functional changes 2018-09-17 10:10:32 -06:00
Michael Kirk
9f35b93647 CR: clarify comment 2018-09-17 10:10:32 -06:00
Michael Kirk
9bca1c8e52 Add some missing nullability annotations 2018-09-17 10:10:32 -06:00
Michael Kirk
b3d3c27f39 CR: Split operations into separate files (no changes in functionality) 2018-09-17 10:10:32 -06:00
Michael Kirk
ff3e9bcdd1 cr: add comment about operation queue 2018-09-17 10:10:32 -06:00
Michael Kirk
bfd8eb63c6 Add some comments/nullability annotations for clarity 2018-09-17 10:10:32 -06:00
Michael Kirk
c9218b59ca CR: add operation queue name 2018-09-17 10:10:32 -06:00
Michael Kirk
5a7d7634bf store keys before uploading to avoid race condition with service 2018-09-17 10:10:32 -06:00
Michael Kirk
1853e79c3e Don't retry send until SPK has been rotated
// FREEBIE
2018-09-17 10:10:32 -06:00
Michael Kirk
5e1306aaa5 Restore check debounce 2018-09-17 10:10:32 -06:00
Michael Kirk
8e488b5c3b remove unused code 2018-09-17 10:10:32 -06:00
Michael Kirk
85d35b52d6 restore PreKey upload failure tracking 2018-09-17 10:10:32 -06:00
Michael Kirk
39b691b697 Fix operations not being de-alloced 2018-09-17 10:10:32 -06:00
Michael Kirk
619597cd61 ensure operations run to completion on the PreKey operation queue 2018-09-17 10:10:32 -06:00
Michael Kirk
3df0e72eda Extract SPK rotation and CreatePreKey operations 2018-09-17 10:10:32 -06:00
Michael Kirk
286d3c8ce9 Serialize RefreshKeyOperation
TODO

-[] rotate signed prekey job
-[] verify current prekey w/ server
-[] create keys
2018-09-17 10:10:32 -06:00
Michael Kirk
01811a4891 fix swift method signature 2018-09-17 10:10:32 -06:00
Michael Kirk
b11bd6ea46 extract convenience intitializer for param parser 2018-09-17 10:10:32 -06:00
Michael Kirk
1eb05c1d01 remove unused preKeyLastResort 2018-09-17 10:10:32 -06:00