Commit Graph

482 Commits

Author SHA1 Message Date
Matthew Chen
3cedd3ccdf Overhaul database observation. 2020-06-18 09:28:49 -03:00
Matthew Chen
28ff9ac453 Rework model read caches. 2020-06-06 17:37:30 -03:00
Matthew Chen
7298549e98 Resolve issues related to groups v2 in test suites. 2020-06-04 09:40:38 -03:00
Nora Trapp
57a810658a Goodbye iOS 10 2020-05-27 17:34:32 -07:00
Matthew Chen
6b4f192b1b Remove usage of retainUntilComplete. 2020-05-22 09:51:12 -03:00
Nora Trapp
879fe738cf Fix tests 2020-05-18 20:48:08 -07:00
Matthew Chen
a58ea46ac1 Fix broken tests. 2020-05-18 13:32:52 -03:00
Matthew Chen
f8b9b209ff Respond to CR. 2020-05-11 10:19:52 -03:00
Matthew Chen
c2cb189e16 Add TSIncomingMessageBuilder. 2020-05-11 09:28:13 -03:00
Nora Trapp
f0d7a9cb9c Add early message handling for delivery receipts, reactions, and delete for everyone 2020-04-16 19:44:45 -07:00
Matthew Chen
c7df10eb36 Apply CGSize(square:). 2020-04-06 11:34:21 -03:00
Matthew Chen
eb8b14ae98 Fix tests. 2020-04-06 11:01:04 -03:00
Matthew Chen
8ce7fce76b Fix tests. 2020-04-06 11:00:57 -03:00
Matthew Chen
7e7322420a Fix broken tests. 2020-04-03 16:33:02 -03:00
Nora Trapp
c7fdc330c4 Fix registration test 2020-04-03 11:17:01 -07:00
Nora Trapp
2e6612525a Fix broken tests 2020-03-24 17:11:02 -07:00
Michael Kirk
f927ef1b4b Batch Select / Delete 2020-03-20 19:36:48 -07:00
Nora Trapp
78c5c19def fix some tests 2020-03-14 10:43:56 -07:00
Michael Kirk
519c1ca53c fix intermittent failure to load search items
If the load result is contiguous with the already loaded items, we append
rather than replace.

background:

We have 4 load flavors:
    - load older (scrolling up)
    - load more recent (scrolling down after unload)
    - load most recent (initial page load or scroll down button)
    - load around (arbitrary jump from search results or tapping quoted reply)

Previously only "load earlier" and "load later" would append their results to
the existing loaded items, trimming if necessary.

"load most recent" and "load around" would not append, instead they'd replace
the existing loaded items, since the loaded items might not be contiguous with
the existing loaded items.

An optimization we have is that when given a load request, we compare to the
already-loaded items to determine which "unfetched" items from the request
actually need to be fetched.

The error: we consulted the already-loaded items for "load most recent" and
"load around" modes, which discard the previously-loaded items to avoid
introducing a discontinuity in case the fetched items are far away in message
history.

Pseudo code example:

    // given these already loaded items
    alreadyLoaded = [1, 2, 3, 4, 5]

    // if we have a search result for message 5, we'll request to "load around" 5
    requestLoadedAround(5) ->
      // we'll generate a request set around 5
      requestSet = (3..<8)

      // The problem is here, when we remove already-loaded items
      unfetched = requestSet - alreadyLoaded // == [6, 7, 8]

      // Since "load around" replaced the loaded set, rather than appending to
      // it, we inadverently lost some important items (3, 4, 5) from our
      // request set.
      alreadyLoaded = unfetched

A simple solution would be to not consider alreadyLoaded when replacing rather than appending -
for "load around" or "load most recent" but not for "load older" and "load more recent".

    alreadyLoaded = [1, 2, 3, 4, 5]

    requestLoadedAround(5) ->
      requestSet = (3..<8)

      // fetch everything rather than worry about removing the
      // already-fetched-items
      unfetched = requestSet

      alreadyLoaded = unfetched

When we're making large discontiguous jumps in the conversation history this
behavior of replacing rather than appending is unavoidable, but when doing
short hops it's wasteful to lose the already loaded items.

So now, whether the load be via "load older", "load more recent", "load most
recent", or "load around" - whenever the fetched items are contiguous with the
already loaded items, we append rather than replace.
2020-03-12 11:43:32 -06:00
Michael Kirk
414bcbab95 New CDS endpoint 2020-03-04 10:08:55 -07:00
Matthew Chen
529dbf09cd Fix unit tests. 2020-02-28 16:30:54 -03:00
Matthew Chen
7624bcf13e Fix unit tests. 2020-02-28 16:30:54 -03:00
Matthew Chen
81638f8b88 Fix unit tests. 2020-02-28 16:30:54 -03:00
Michael Kirk
f198d9037d Merge tag '3.5.0.5' 2020-02-19 19:26:05 -07:00
Michael Kirk
f406de7797 plumb through messageRequest circumstance when marking as read 2020-02-16 13:13:12 -07:00
Michael Kirk
8d6ba881c7 fixup registration test 2020-02-14 12:17:50 -07:00
Nora Trapp
1cf95c620b Merge branch 'release/3.4.0' 2020-02-05 12:27:48 -08:00
Michael Kirk
4c1afa18a6 secondary devices update capabilities w/ devices endpoint 2020-02-05 10:38:43 -07:00
Matthew Chen
91d100c792 Rework group updates; rework "update group" view to use GroupManager.
* Introduce GroupMembership & GroupAccess.
* Pull out GroupsV2Test.
* Fix issues in groups v2 logic.
2020-01-27 11:18:21 -03:00
Matthew Chen
3b17c39f2e Fix tests. 2020-01-23 12:09:31 -03:00
Matthew Chen
8ecc50fb98 Fix tests. 2020-01-23 12:09:31 -03:00
Nora Trapp
b7411bcb40 Implement final KBS master key encryption 2020-01-20 16:16:57 -08:00
Matthew Chen
892ce5c135 Rework message processing to handle groups v2. 2020-01-17 17:34:37 -03:00
Matthew Chen
1ae6012ecb Create and fetch groups v2; group update roundtrip. 2020-01-17 17:29:00 -03:00
Michael Kirk
0490530a45 remove ContactQuery tests 2020-01-15 19:14:18 -07:00
Michael Kirk
032feb3b9c speed up FTS deletes/updates 2020-01-14 09:40:45 -07:00
Nora Trapp
5e7de7391a Fix tests 2020-01-09 13:17:09 -08:00
Matthew Chen
72f912dce3 Versioned profile changes, etc. 2020-01-08 13:54:54 -03:00
Michael Kirk
896b53a32d Fix crash in message mapping when deleting lots of messages in a smallish conversation 2020-01-07 18:36:30 -07:00
Nora Trapp
4d55468bd3 Merge branch 'release/3.2.0' 2020-01-02 16:50:14 -08:00
Michael Kirk
884f09ea5a Windowed conversation loading 2019-12-31 14:29:32 -08:00
Michael Kirk
ccfde14b00 fixup tests 2019-12-31 14:26:53 -08:00
Nora Trapp
4e0dd580c3 Fix iOS 13 SDK NSData scrubbing 2019-12-27 15:53:47 -08:00
Matthew Chen
f3286b755b Fix broken tests. 2019-12-11 20:41:57 -08:00
Matthew Chen
29150102cb Revert group and profile changes. 2019-12-11 20:41:54 -08:00
Matthew Chen
6b73cc08f6 Merge tag '3.0.6.0' 2019-12-07 19:17:20 -03:00
Matthew Chen
12baeea389 Respond to CR. 2019-12-06 18:33:56 -03:00
Matthew Chen
0e96c585ce Add perf test around enumerating special messages. 2019-12-06 17:18:42 -03:00
Matthew Chen
e39375c944 Add perf test around enumerating special messages. 2019-12-06 17:06:34 -03:00
Matthew Chen
0f8b2ccc74 Fix broken tests. 2019-12-05 12:37:22 -03:00