Page MenuHomePhabricator

[web] start using threads from database
ClosedPublic

Authored by kamil on Nov 23 2023, 6:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 10:31 AM
Unknown Object (File)
Sat, Nov 23, 8:01 AM
Unknown Object (File)
Sat, Nov 23, 7:20 AM
Unknown Object (File)
Sat, Nov 23, 6:22 AM
Unknown Object (File)
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)
Oct 27 2024, 5:22 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #33569)

I think your IDE added this

tomek added inline comments.
keyserver/src/responders/redux-state-responders.js
95 ↗(On Diff #33569)

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

161 ↗(On Diff #33569)

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 ↗(On Diff #33569)

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

72 ↗(On Diff #33569)

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 ↗(On Diff #33569)

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

web/redux/initial-state-gate.js
33 ↗(On Diff #33569)

ahhh... IDE did it again 😠

65 ↗(On Diff #33569)

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

72 ↗(On Diff #33569)

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.