HomePhabricator
Diffusion Comm 481c30533aa3

[lib] Fix highestTimestamp assignment in useGetLastUpdatedTimes

Description

[lib] Fix highestTimestamp assignment in useGetLastUpdatedTimes

Summary:
highestTimestamp is used for setting lastUpdatedAtMostTime. The purpose of lastUpdatedAtMostTime is specifically for use in ChatThreadItemLoaderCache, where it specifies the order in which we test messages to get a final lastUpdatedTime.

We want to test messages in the order of lastUpdatedAtMostTime so that we can conclude when all of the non-resolves messages can be guaranteed to have a lower timestamp than the ones that have already resolved.

The current behavior here is broken because we're only setting highestTimestamp in cases where the time doesn't need to be resolved. We should be setting it to the absolute largest possible value that we could get after resolution, which is going to be the timestamp of the most recent message.

Depends on D14494

Test Plan: I tested this along with the rest of the stack by making sure that everything still worked on my physical device with a release build, and that performance was not degraded

Reviewers: tomek, angelika

Reviewed By: tomek

Differential Revision: https://phab.comm.dev/D14495

Details

Provenance
ashoatAuthored on Mon, Mar 24, 8:11 AM
Reviewer
tomek
Differential Revision
D14495: [lib] Fix highestTimestamp assignment in useGetLastUpdatedTimes
Parents
rCOMM79d733cfa348: [lib] Only use threadInfo.creationTime for lastUpdatedTime if no messages
Branches
Loading...
Tags
Loading...