Page MenuHomePhabricator

[keyserver] add community creation logic to farcaster webhook responder
Needs ReviewPublic

Authored by will on Tue, Oct 22, 9:44 PM.
Tags
None
Referenced Files
F3049324: D13775.diff
Wed, Oct 23, 3:31 AM
F3048719: D13775.id45333.diff
Wed, Oct 23, 12:29 AM
F3048714: D13775.id.diff
Wed, Oct 23, 12:29 AM
F3048709: D13775.diff
Wed, Oct 23, 12:29 AM
Subscribers

Details

Reviewers
ashoat
varun
Summary

This adds the logic for communtity creation to the farcaster webhook responder. We either decide to early return or continue to sidebar creation with the resulting channelCommunityID.

In the case that AUTHORITATIVE_FARCASTER_BOT is set, we create new communities if they haven't already been created and tagged through the blob service or default to the no channel community if no channel was specified.

Test Plan

I used rahul's testingthings channel for testing this. I created a webhook event by tagging myself with #createathread. I then copied this webhook event and used it to trigger the responder.

On staging, I created a dummy user with rahul's fid as well as a dummy user with my fid. In triggering the responder with AUTHORITATIVE_FARCASTER_BOT set to true, confirmed that the community was created with rahul set to admin.

Reset everything to prior and ensured that if rahul's fid didn't exist on staging identity, retriggering the responder resulted in the same community but with the tagger (my fid) as the admin.

Verified community creation through iOS simulator. Properly set as tagged to farcaster testingthings channel

Retriggered responder to verify that it then picked up on the community already existing and returning the proper community threadID.

Depends on D13774

Diff Detail

Repository
rCOMM Comm
Branch
farcaster_bot
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

keyserver/src/responders/farcaster-webhook-responders.js
141

placeholder. channelCommunityID will be used in sidebar creation in following diff

will edited the test plan for this revision. (Show Details)
keyserver/src/responders/farcaster-webhook-responders.js
79–98

With this diff, this function is getting pretty large. I think I'm going to move the webhook validation logic into its own function

keyserver/src/responders/farcaster-webhook-responders.js
28

This is the thread id for the no channel community I created on the prod keyserver

will requested review of this revision.Tue, Oct 22, 10:01 PM