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)
Tue, Nov 12, 11:22 AM
Unknown Object (File)
Sat, Nov 9, 11:01 AM
Unknown Object (File)
Fri, Nov 1, 7:32 PM
Unknown Object (File)
Fri, Nov 1, 7:32 PM
Unknown Object (File)
Fri, Nov 1, 6:51 PM
Unknown Object (File)
Oct 13 2024, 5:21 AM
Unknown Object (File)
Sep 28 2024, 7:15 PM
Unknown Object (File)
Sep 28 2024, 6:28 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.May 28 2024, 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.May 28 2024, 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.