[lib/web/native] Add IntegrityStore
Summary:
Part of ENG-4959
Suggested in D9255, which was a previous attempt at storing hashes in redux
We want to store thread hashes in redux so that we don't have to calculate all of them whenever the state check is triggered. Instead we keep them in sync using thread ops. Additionally the hashes will be now generated based on the client schema so we convert them on the server instead of the client.
On login/register/web page load instead of handling all of the thread updates at once we convert them in batches of 50, one every 0.5s.
Test Plan:
Test:
- opening the web page
- logging in on web and mobile
Check that there are UPDATE_INTEGIRTY_STORE actions with batches and the last one with that sets threadHashingComplete to true
Performance testing:
I've let the integrity handler calculate hashes continuously and checked the behaviour of web app and the native app on iPhone X and some old Android. Didn't see any noticeable performance difference when navigating between threads etc.
Reviewers: tomek, atul, kamil
Reviewed By: tomek
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D9265