HomePhabricator
Diffusion Comm 61c4a3f1c829

[lib] Populate messageStore.threads from threadInfos before…

Description

[lib] Populate messageStore.threads from threadInfos before setMessageStoreMessages

Summary:
See ENG-2275, specifically this comment.

We were seeing an exception being thrown because messageStore.threads was missing a thread that was in SQLite. Calling updateMessageStoreWithLatestThreadInfos before this exception might help address the issue by making sure messageStore.threads has an entry for every threadInfo that we have in SQLite.

The exception may still be thrown after this diff, but it would require SQLite's threads table to be inconsistent with its messages table, rather than just redux-persist's messageStore.threads being inconsistent with SQLite's messages table.

Test Plan: Confirm that issue in ENG-2275 no longer repros

Reviewers: atul, tomek

Reviewed By: atul

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