HomePhabricator
Diffusion Comm c33195d6f74a

[lib] Default to first read chat thread in chatListData

Description

[lib] Default to first read chat thread in chatListData

Summary:
This diff updates mostRecentReadThread, which is only used on web. We use it to determine what thread to show by default.

With the implementation of sidebars, one confusing thing was that mostRecentReadThread could return a sidebar. But if we excluded sidebars, it might select the second top-level thread instead of the first, if the most recent (non-sidebar) message in the second thread was newer than the in the first, but the first had a sidebar with a newer message.

This diff makes sure that mostRecentReadThread always returns the first thread by chatListData.

Test Plan: Load the /chat/ route under a variety of conditions, including the complex one I mentioned above, and make sure the very first top-level thread in chatListData is always the default

Reviewers: KatPo, palys-swm

Reviewed By: KatPo, palys-swm

Subscribers: zrebcu411, Adrian

Differential Revision: https://phabricator.ashoat.com/D465

Details

Provenance
Ashoat Tevosyan <ashoat@gmail.com>Authored on Nov 30 2020, 9:58 PM
Reviewer
KatPo
Differential Revision
Restricted Differential Revision
Parents
rCOMMcbd2cf755235: [web] Persist InputState outside of Chat tab
Branches
Unknown
Tags
Unknown