Page MenuHomePhabricator

[web] Persist userStore in db
ClosedPublic

Authored by michal on Apr 3 2024, 6:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 17 2024, 6:46 AM
Unknown Object (File)
Nov 17 2024, 6:35 AM
Unknown Object (File)
Nov 3 2024, 2:09 AM
Unknown Object (File)
Oct 25 2024, 5:06 PM
Unknown Object (File)
Oct 25 2024, 4:43 AM
Unknown Object (File)
Oct 11 2024, 12:18 PM
Unknown Object (File)
Oct 11 2024, 12:18 PM
Unknown Object (File)
Oct 11 2024, 12:18 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.Apr 3 2024, 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.Apr 5 2024, 3:43 AM

Fix path, spread type instead of repeating.