HomePhabricator
Diffusion Comm 5fede8afd7b6

[lib/web/native] Add IntegrityStore

Description

[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

Details

Provenance
Michal Gniadek <michal.gniadek@swmansion.com>Authored on Sep 21 2023, 8:51 AM
Reviewer
tomek
Differential Revision
D9265: [lib/web/native] Add IntegrityStore
Parents
rCOMMc610c2ea44ac: [native] simplify RelationshipListItem jsx
Branches
Unknown
Tags
Unknown

Event Timeline

Michal Gniadek <michal.gniadek@swmansion.com> committed rCOMM5fede8afd7b6: [lib/web/native] Add IntegrityStore (authored by Michal Gniadek <michal.gniadek@swmansion.com>).Oct 10 2023, 2:28 AM