Commit graph

9014 commits

Author SHA1 Message Date
Michael Kirk 04a52980a3 fixup migration
- nested transaction for enumeration
- save when complete
2018-09-26 09:55:23 -06:00
Michael Kirk fe7d69e9c6 Update thread's sorting order based on whatever the currently last message is 2018-09-26 09:52:34 -06:00
Michael Kirk 02692e42bd remove addressed TODO's 2018-09-26 09:52:34 -06:00
Michael Kirk c2f87c738a trivial replace of timestampForSorting -> sortId in some logging 2018-09-26 09:52:34 -06:00
Michael Kirk c21020d7e7 Use received date for footer-collapse supression 2018-09-26 09:52:34 -06:00
Michael Kirk 6f8eddc955 unread indicator uses sortId
- removed timestamp parameter. This wasn't totally obvious, previously we were tracking two pieces of state

1. `unreadIndicator.firstUnseenTimestamp`:
    the first unseen timestamp for a conversation that exists in the database
2. `unreadIndicator.timestamp`:
    the timestamp of the first interaction *after* the unread indicator that fits in the loading window

We don't actually need to track `2` because it was only used in a comparison like:

   viewItem.interaction.timestampForSorting >= unreadIndicator.timestamp

But by definition, unreadIndicator.firstUnseenTimestamp is always less than or
equal to unreadIndicator.timestamp. Put into terms of the `sortId` corallary,
the sortId of the first unseen interaction in the database is always less than
or equal to the sortId of the first unseen interaction that fits in the loading
window.

In other words, there's no situation where

   viewItem.interaction.sortId >= unreadIndicator.firstUnseenSortId
2018-09-26 09:52:34 -06:00
Michael Kirk 3240e0d9d0 Be explicit about receivedAt time
We were often using `timestampForLegacySorting`, which is convoluted for when
we actually just want received time.

In some sense this is a superficial change, but it's part of auditing that
we've completed moved away from timestampForLegacySorting.
2018-09-26 09:52:34 -06:00
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 2eb3ec6d0c benchmark migration 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 c27d35f8f2 sort search results by sortId 2018-09-26 09:52:34 -06:00
Michael Kirk 1459fad01a sort media gallery by sortId 2018-09-26 09:52:33 -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 d6d6c4fca4 ConversationVC - lastSeenSortId 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 6c5fbc6de5 Update existing contact offers in place
WIP: migration / autoincrement logic

TODO:

-[x] 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?

fixup contact offers
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 ae668ceca9 include sequence number in fake messages 2018-09-26 09:52:33 -06:00
Michael Kirk 87509df26a Merge branch 'mkirk/fix-release-compile' into release/2.30.1 2018-09-26 08:09:25 -06:00
Matthew Chen 72562920ed Fix author conversation colors. 2018-09-26 09:19:12 -04:00
Michael Kirk bccb633b6c fix release compile 2018-09-25 17:16:12 -06:00
Michael Kirk 4b9d720b9f ignore RI check for unreleased 2.30 tags 2018-09-25 15:43:38 -06:00
Michael Kirk 306c6ade71 "Bump build to 2.30.1.0." 2018-09-25 15:42:20 -06:00
Matthew Chen 4186ce9a72 Respond to CR. 2018-09-25 17:05:26 -04:00
Matthew Chen 7b2dd19fb8 Respond to CR. 2018-09-25 16:11:37 -04:00
Matthew Chen 8910f1f65a Enable conversation colors. 2018-09-25 16:11:37 -04:00
Matthew Chen ae84528dc3 Update avatar colors; add shaded conversation color constants, modify color picker to be color-name-based, not color-based, use shaded conversation colors, remove JSQ. 2018-09-25 16:11:37 -04:00
Matthew Chen c89033591d Merge branch 'charlesmchen/converationColorsMessageStatusLayout' 2018-09-25 16:10:49 -04:00
Matthew Chen a5628c4204 Rework layout of message status in home view. 2018-09-25 16:09:22 -04:00
Matthew Chen f0155c529e Merge branch 'charlesmchen/converationColorsUnreadBadges' 2018-09-25 15:51:57 -04:00
Matthew Chen 0701d2465b Replace shadow with stroke. 2018-09-25 15:51:51 -04:00
Matthew Chen 8106158780 Move unread badge on home view; propose shadow. 2018-09-25 15:51:51 -04:00
Matthew Chen 4b5021d8fd Merge branch 'charlesmchen/darkThemeReminders' 2018-09-25 15:51:02 -04:00
Matthew Chen d13624897d Fix reminder changes in home view. 2018-09-25 15:50:51 -04:00
Matthew Chen 0eb13dd827 Fix nag reminder v. dark theme. 2018-09-25 15:50:51 -04:00
Matthew Chen a02a5160f4 Merge branch 'charlesmchen/offerButtonMargins' 2018-09-25 15:49:38 -04:00
Matthew Chen b30bfec21f Fix contact offer button margins. 2018-09-25 15:49:15 -04:00
Matthew Chen 9c6902d179 Merge branch 'charlesmchen/contactUtils' 2018-09-25 15:48:39 -04:00
Matthew Chen 0b7d269017 Rename DebugContactsUtils. 2018-09-25 15:48:27 -04:00
Matthew Chen bcee59f5e5 Add contact utils class. 2018-09-25 15:46:08 -04:00
Matthew Chen 6a5935c6e8 Merge branch 'charlesmchen/fix-ssk-tests-o' 2018-09-21 09:24:11 -04:00
Matthew Chen be76267105 Update cocoapods. 2018-09-21 09:23:19 -04:00
Matthew Chen 98630cca50 Respond to CR; add db utility methods to test base classes. 2018-09-21 09:21:34 -04:00