Page MenuHomePhabricator

[lib] SyncCommunityStoreHandler
ClosedPublic

Authored by varun on Oct 29 2024, 1:59 PM.
Tags
None
Referenced Files
F3385130: D13810.id45465.diff
Thu, Nov 28, 11:30 PM
F3384718: D13810.id45440.diff
Thu, Nov 28, 10:25 PM
F3384654: D13810.id45440.diff
Thu, Nov 28, 10:09 PM
Unknown Object (File)
Mon, Nov 25, 9:37 AM
Unknown Object (File)
Mon, Nov 25, 9:33 AM
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
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

debounce fetch community infos

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

ashoat requested changes to this revision.Oct 29 2024, 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 ↗(On Diff #45440)

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.Oct 29 2024, 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.