Page MenuHomePhabricator

[lib] change fetchFarcasterChannelByName -> fetchFarcasterChannelByID and refactor
Needs ReviewPublic

Authored by varun on Tue, Oct 15, 12:44 PM.
Tags
None
Referenced Files
F2982157: D13718.diff
Wed, Oct 16, 1:50 AM
F2979722: D13718.diff
Tue, Oct 15, 4:50 PM
F2979260: D13718.id45207.diff
Tue, Oct 15, 3:35 PM
F2979212: D13718.id.diff
Tue, Oct 15, 3:34 PM
F2979189: D13718.diff
Tue, Oct 15, 3:33 PM
F2978757: D13718.diff
Tue, Oct 15, 2:20 PM
Subscribers

Details

Reviewers
ashoat
Summary

realized we're conflating channel name and ID in our code. this change cleans things up a little and makes sure we're querying by ID

Depends on D13695

Test Plan

called fetchFarcasterChannelByID with a channel name ("Crypto Fantasy League") and didn't get back a response. called it again with a channel ID ("fantasyisland") and got the right response

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

varun published this revision for review.Tue, Oct 15, 12:46 PM

I see D13717 was landed already but I think this diff is still an improvement. Will rebase and wait for CI before landing

lib/utils/neynar-client.js
152

Even though we only call this function from fetchFarcasterChannelByID, I think it's a useful change. we may want to query by name in the future and both types of queries use the same underlying neynar api

ashoat requested changes to this revision.Tue, Oct 15, 2:00 PM

Glad you independently found the id/name bug!

I don't think we need support for fetching by name right now. Can you simplify this to just a rename?

lib/utils/neynar-client.js
152

I think this is overengineering. I don't think it's worth having this complexity in the codebase for a hypothetical future use case. We can always introduce it later when we determine that use case is needed. In general, this approach of building for hypothetical cases hurts readability and bloats the codebase, increasing the amount of maintenance required

This revision now requires changes to proceed.Tue, Oct 15, 2:00 PM