Page MenuHomePhabricator

[lib] update message store threads in SQLite after setting client DB store
ClosedPublic

Authored by kamil on Apr 25 2023, 10:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 10:29 PM
Unknown Object (File)
Sat, Dec 14, 10:29 PM
Unknown Object (File)
Sat, Dec 14, 10:27 PM
Unknown Object (File)
Sat, Dec 14, 10:07 PM
Unknown Object (File)
Nov 24 2024, 5:36 AM
Unknown Object (File)
Nov 11 2024, 1:27 AM
Unknown Object (File)
Nov 11 2024, 1:27 AM
Unknown Object (File)
Nov 10 2024, 8:34 PM
Subscribers

Details

Summary

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

Test Plan

Close and open app multiple times to call this code and check if comparing this with redux-persist is not failing

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable