Page MenuHomePhabricator

[lib] SyncCommunityStoreHandler
ClosedPublic

Authored by varun on Tue, Oct 29, 1:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 8:07 AM
Unknown Object (File)
Thu, Nov 14, 9:35 AM
Unknown Object (File)
Mon, Nov 11, 12:23 AM
Unknown Object (File)
Sun, Nov 10, 5:45 PM
Unknown Object (File)
Thu, Nov 7, 3:16 AM
Unknown Object (File)
Wed, Nov 6, 12:13 PM
Unknown Object (File)
Wed, Nov 6, 10:19 AM
Unknown Object (File)
Wed, Nov 6, 8:09 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.