Page MenuHomePhabricator

[keyserver/lib] upate createOrUpdateFarcasterChannelTag to use communites table
AcceptedPublic

Authored by ginsu on Thu, May 9, 9:23 AM.
Tags
None
Referenced Files
F1794906: D11975.diff
Sun, May 19, 4:23 PM
Unknown Object (File)
Sat, May 18, 11:10 AM
Unknown Object (File)
Sat, May 18, 5:14 AM
Unknown Object (File)
Fri, May 17, 5:59 PM
Unknown Object (File)
Thu, May 16, 10:00 AM
Unknown Object (File)
Wed, May 15, 6:36 PM
Unknown Object (File)
Tue, May 14, 3:41 PM
Unknown Object (File)
Mon, May 13, 5:39 PM
Subscribers

Details

Reviewers
tomek
kamil
Summary

Now that we have a communities table that was introduced in D11903, we can use it to better improve our createOrUpdateFarcasterChannelTag method

Linear task: https://linear.app/comm/issue/ENG-7647/modify-existing-create-or-update-farcaster-channel-endpoint-to-update

Depends on D11955

Test Plan

Tagged a farcaster channel and confirmed that the farcaster channel id and the blob holder were populated in correct row of the communities table

Screenshot 2024-05-09 at 12.26.20 PM.png (376×1 px, 151 KB)

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu edited the test plan for this revision. (Show Details)
ginsu added reviewers: tomek, kamil.
keyserver/src/creators/farcaster-channel-tag-creator.js
28

Removed this since when I was working I found myself confused with if I was using the farcasterChannelID from the request or the farcasterChannelID from the community info I just fetched from fetchCommunityInfosPromise

lib/actions/community-actions.js
51

Initially we were returning the blobHolder so that we can temporarily store it in redux; however, now that we can store the blobHolder in the communities table on the keyserver, we shouldn't return this back to the client

ginsu requested review of this revision.Thu, May 9, 9:44 AM
keyserver/src/creators/farcaster-channel-tag-creator.js
39–42

I would inline these

78–82

Alignment issues

87–88

Can these be named oldChannelID and oldHolder for clarity?

tomek added inline comments.
keyserver/src/creators/farcaster-channel-tag-creator.js
77–88

There's a slight edge case here - values in the DB could have changed between fetch and update. It would be ideal if this update query would return the values from before the update. Maybe it is something a RETURNING clause could achieve?

This revision is now accepted and ready to land.Fri, May 10, 4:04 AM