Page MenuHomePhabricator

[lib] SyncCommunityStoreHandler
ClosedPublic

Authored by varun on Tue, Oct 29, 1:59 PM.
Tags
None
Referenced Files
F3100783: D13810.id45450.diff
Wed, Oct 30, 4:57 AM
F3100782: D13810.id45439.diff
Wed, Oct 30, 4:57 AM
F3100781: D13810.id45433.diff
Wed, Oct 30, 4:57 AM
F3100780: D13810.id45440.diff
Wed, Oct 30, 4:57 AM
F3100761: D13810.id.diff
Wed, Oct 30, 4:56 AM
F3100752: D13810.diff
Wed, Oct 30, 4:55 AM
Subscribers

Details

Summary

With the introduction of the farcasterBot, it's possible for a user to be added to a community and not have this community in their communityStore. in this scenario, the UpdateHandler should handle adding the community thread to the threadStore. the handler in this diff will check if any of the COMMUNITY_ROOT threads are missing in the communityStore. If there are missing communities, callFetchCommunityInfos is invoked

Test Plan

applied this patch and confirmed with logs that my handler was invoked. also confirmed that communityStore was immediately updated and thread avatars were immediately rendered

Diff Detail

Repository
rCOMM Comm
Branch
arcpatch-D13810
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

varun requested review of this revision.Tue, Oct 29, 2:17 PM

debounce fetch community infos

undo debounce, which didn't seem to work as expected

ashoat requested changes to this revision.Tue, Oct 29, 5:24 PM

There’s a risk here that if a community root ends up in the thread store, but its keyserver isn’t returning it when queried here, then we could end up querying over and over. Can you make sure that we only trigger a query once for each ID? We have something similar in UserInfosHandler: https://github.com/CommE2E/comm/blob/603f6924736f20014f39c6b57dffe4e39c9ba7d4/lib/handlers/user-infos-handler.react.js#L43

lib/components/sync-community-store-handler.react.js
29

You aren’t considering announcement roots. There’s a utility function to check if a thread type is a community root

This revision now requires changes to proceed.Tue, Oct 29, 5:24 PM
This revision is now accepted and ready to land.Wed, Oct 30, 4:35 AM
This revision was automatically updated to reflect the committed changes.