Page MenuHomePhabricator

[web] Persist userStore in db
ClosedPublic

Authored by michal on Wed, Apr 3, 6:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 14, 5:26 PM
Unknown Object (File)
Fri, Apr 12, 9:10 AM
Unknown Object (File)
Thu, Apr 11, 10:34 PM
Unknown Object (File)
Thu, Apr 11, 8:33 PM
Unknown Object (File)
Thu, Apr 11, 4:52 PM
Unknown Object (File)
Thu, Apr 11, 2:42 PM
Unknown Object (File)
Thu, Apr 11, 8:44 AM
Unknown Object (File)
Wed, Apr 10, 4:12 PM
Subscribers

Details

Summary

ENG-7069 : Start performing user store ops on worker
Part of ENG-3490 : Migrate stores to SQLite on web

Start persting userStore on web, inside of sqlite db.

Depends on D11537

Test Plan
  • Open web app, check that the "migration" runs and:
    • Ops with userStore from keyserver are dispatched to the db
    • Redux contains the data
  • Reload the web app and check that:
    • Keyserver doesn't send the user info
    • User info is loaded from db and dispatched in setInitialReduxState action
  • Play around with the app check if there are any errors
    • Add an unknown user to the friend list
    • Block user
    • Using two clients change the avatar on one and check if it gets synced on the other

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

web/types/redux-types.js
30–31 ↗(On Diff #38725)

For some reason, flow previously allowed removing threadStore from InitialReduxState and passing the object to the dispatch. After my changes it throws an error so I decided to introduce a new action payload. The fields that are persisted (threadStore, userInfos) instead of taken from keyserver are marked as optional.

michal requested review of this revision.Wed, Apr 3, 6:28 AM

Realized that user infos are used by navinfo in redux state responder so separated the new promise.

This will need a major refactor anyway in ENG-5179 : Handle initial state for multiple keyservers

Could you extend the test plan to

  1. Add an unknown user to the friend list
  2. Block user
  3. Using two clients change the avatar on one and check if it gets synced on the other

Refreshing app multiple time between steps

web/redux/initial-state-gate.js
30 ↗(On Diff #38840)
web/types/redux-types.js
26–38 ↗(On Diff #38840)

nit: what do you think about it?

This revision is now accepted and ready to land.Fri, Apr 5, 3:43 AM

Fix path, spread type instead of repeating.