Page MenuHomePhabricator

[keyserver/lib/web] include communityStore in the initialReduxState
AbandonedPublic

Authored by ginsu on May 15 2024, 6:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 19, 2:06 AM
Unknown Object (File)
Mon, Jun 17, 10:30 PM
Unknown Object (File)
Mon, Jun 17, 10:29 PM
Unknown Object (File)
Tue, Jun 11, 6:28 PM
Unknown Object (File)
Sat, Jun 8, 8:53 AM
Unknown Object (File)
Wed, Jun 5, 10:35 PM
Unknown Object (File)
May 23 2024, 7:02 PM
Unknown Object (File)
May 23 2024, 1:55 PM
Subscribers

Details

Reviewers
tomek
kamil
Summary

We need to include the communityStore in the initialReduxState as part of the work to introducing the communities table in the keyserver

Depends on D12043

Test Plan

Confirmed that the community store with the correct community infos was a part of the SET_INITIAL_REDUX_STATE action payload

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu added reviewers: tomek, kamil.
ginsu edited the summary of this revision. (Show Details)
ginsu edited the summary of this revision. (Show Details)
ginsu added inline comments.
keyserver/src/fetchers/community-fetchers.js
16

As I was testing, noticed this issue, and snuck a fix here

ginsu requested review of this revision.May 15 2024, 6:30 PM
keyserver/src/fetchers/community-fetchers.js
16

I don't see a stack attached to this diff, but I also don't see this file on master. Can you attach a stack, and add this fix to the diff that made the initial error?

One question:
If I remember correctly CommunityStore was introduced directly for SQLite which means web clients should have it - so there is no need to fetch and return it again as this is a duplication of data client should have.
If communityStore changed in keyserver DB we should have some mechanism (updates/state sync/handler which fetches it) to get the newest data.

If my suspicion is correct this diff is not needed but I wasn't reviewing the rest of the stack and I am missing some context so sorry for confusing if this was taken into account and this is still needed.

keyserver/src/fetchers/community-fetchers.js
16

D11955 was the offending diff. Just updated it to fix this issue.

tomek requested changes to this revision.Tue, May 28, 4:47 AM

One question:
If I remember correctly CommunityStore was introduced directly for SQLite which means web clients should have it - so there is no need to fetch and return it again as this is a duplication of data client should have.
If communityStore changed in keyserver DB we should have some mechanism (updates/state sync/handler which fetches it) to get the newest data.

If my suspicion is correct this diff is not needed but I wasn't reviewing the rest of the stack and I am missing some context so sorry for confusing if this was taken into account and this is still needed.

With the refresher approach we don't need to persist this data at all - opening the drawer / focusing web app would result in new data being sent from the keyserver.

If we don't trust our persistence, we can keep this diff and persist its result on clients - this would mean that we never use the persisted state on the web. Later we can update the approach.

In the final approach, we would need the clients to send an additional parameter telling if the server should include communityStore in the initial state. An alternative might be to abandon this diff and avoid sending the store in the initial state.

Requesting changes because we need to make a decision here.

This revision now requires changes to proceed.Tue, May 28, 4:47 AM

An alternative might be to abandon this diff and avoid sending the store in the initial state.

This makes sense and since we only use this info when we open the community drawer on native and when we focus the app on web, abandoning this diff is probably the best approach for now so that we can keep the scope limited.