This adds a missing part of updating message store threads after getting all data from the database. This handle rare case when there is a message but without threadID entry in threads.
Note: This is a different approach than in the rest of the code.
In general, we create ops, and use these ops for updating both state and DB (ops are later converted to database and passed to CommCoreModule).
Here, we compute messageIDs based on data from messages table - that being said each thread will be updated and will have updated only messageIDs fields. Since messageIDs are not persisted, this will cause an unnecessary updates of all threads, but with the same values which is a lot of useless computation.
To avoid this, creating an operation only for adding a new thread that is not present in the database yet.
In this case, asserting equal states makes no sense.
Depends on D7612