[lib] Merge new messages when truncationStatuses are empty but there's an updated thread
[lib] Merge new messages when truncationStatuses are empty but there's an updated thread

Summary: When a user sends a message to a pending thread, we add this message to a store. Then, when some other user creates the same thread, we receive UPDATE_THREAD update. It's possible, for this update, to be received before JOIN_THREAD, which will result in returning old message store. In this scenario, there are no new messages in the UPDATE_THREAD update, but we still need to call `mergeNewMessages` to reassign messages from pending to realized thread.

Test Plan: This diff shouldn't cause any visible change. Tested with the next diff.

Reviewers: ashoat

Reviewed By: ashoat

Subscribers: KatPo, Adrian, atul

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

Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal