Page MenuHomePhabricator

[web] start using threads from database
ClosedPublic

Authored by kamil on Nov 23 2023, 6:06 AM.
Tags
None
Referenced Files
F3353078: D9959.id33716.diff
Sat, Nov 23, 8:01 AM
F3352927: D9959.id33569.diff
Sat, Nov 23, 7:20 AM
F3352541: D9959.id33721.diff
Sat, Nov 23, 6:22 AM
F3351909: D9959.diff
Sat, Nov 23, 4:00 AM
Unknown Object (File)
Fri, Nov 8, 12:58 AM
Unknown Object (File)
Thu, Nov 7, 10:53 PM
Unknown Object (File)
Sun, Oct 27, 5:22 PM
Unknown Object (File)
Sat, Oct 26, 4:26 PM
Subscribers

Details

Summary
  1. Migrate threads to DB when needed
  2. Use threads from DB and avoid fetching from keyserver when data is present.

Depends on D9956

Test Plan

Test plan was done twice, in Chrome and Safari:

  1. Check if migrating works
  2. Check if threads are not fetched from keyserver when there are in DB
  3. Modify thread and reload app
  4. Modify thread on different account
  5. Close app, modify thread on different account and open app (test if checkpointing works)

I tested this on the account with ~4k threads, I didn't notice any perf downgrade, moreover, I think initial app load was faster when reading threads from DB.

Diff Detail

Repository
rCOMM Comm
Branch
publish-web-persistence
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Nov 23 2023, 6:36 AM
web/redux/initial-state-gate.js
33

I think your IDE added this

tomek added inline comments.
keyserver/src/responders/redux-state-responders.js
95

Can we use canUseDatabaseOnWeb from https://phab.comm.dev/D9948?

161

I'm wondering if it would be beneficial to differentiate between empty thread infos and excluding them. So in this case, instead of returning an empty object, we would return e.g. null. Would that be useful?

web/redux/initial-state-gate.js
65

Should we check the length just like in https://phab.comm.dev/D9954?

72

Can we use canUseDatabaseOnWeb?

This revision is now accepted and ready to land.Nov 24 2023, 3:55 AM

address review

keyserver/src/responders/redux-state-responders.js
161

I don't think that improves or changes anything, there is no advance in the current state.

web/redux/initial-state-gate.js
33

ahhh... IDE did it again 😠

65

This is the result of the function from D9954. So the check if inside getClientStore

72

sure, that was my idea but I messed something while creating diff

fix condition, add check if user is logged in

This revision was landed with ongoing or failed builds.Nov 27 2023, 6:47 AM
This revision was automatically updated to reflect the committed changes.