Page MenuHomePhabricator

[native] implement onPressTagChannel for TagUnfollowedFarcasterChannel
ClosedPublic

Authored by ginsu on May 3 2024, 12:49 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 11:51 AM
Unknown Object (File)
Nov 18 2024, 12:35 PM
Unknown Object (File)
Nov 18 2024, 12:24 PM
Unknown Object (File)
Nov 18 2024, 10:26 AM
Unknown Object (File)
Nov 15 2024, 6:06 AM
Unknown Object (File)
Nov 10 2024, 3:22 PM
Unknown Object (File)
Nov 10 2024, 12:10 PM
Unknown Object (File)
Nov 10 2024, 11:41 AM
Subscribers

Details

Summary

This diff implements the logic for onPressTagChannel in TagUnfollowedFarcasterChannel. The important thing about this method is that before dispatching our action promise, we want to validate the input through fetchFarcasterChannelByName

Depends on D11857

Test Plan

Confirmed that fetchFarcasterChannelByName correctly validates the input and createOrUpdateFarcasterChannelTag action is dispatched when the input is valid. Otherwise confirmed that I was logging the error message

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu added a reviewer: inka.
ginsu added inline comments.
native/community-settings/tag-farcaster-channel/tag-unfollowed-farcaster-channel.react.js
72 ↗(On Diff #39759)

This will be implemented in a subsequent diff

ginsu published this revision for review.May 3 2024, 12:53 AM
ginsu edited the summary of this revision. (Show Details)
ginsu edited the test plan for this revision. (Show Details)

will make sure ci passes before landing

native/community-settings/tag-farcaster-channel/tag-unfollowed-farcaster-channel.react.js
57 ↗(On Diff #39759)

This will be implemented in a subsequent diff

ashoat added inline comments.
native/community-settings/tag-farcaster-channel/tag-unfollowed-farcaster-channel.react.js
87 ↗(On Diff #39759)

Should we add .fetchFarcasterChannelByName here?

This revision is now accepted and ready to land.May 4 2024, 11:08 AM
native/community-settings/tag-farcaster-channel/tag-unfollowed-farcaster-channel.react.js
87 ↗(On Diff #39759)

No because .fetchFarcasterChannelByName is a defined within the NeynarClient class, I believe that just adding neynarClientContext.client into our dep list should be enough to correctly memoize this callback.

Additionally in other places where we call methods defined in the NeynarClient, we only add the client as part of our dep list.

https://github.com/CommE2E/comm/blob/master/lib/components/farcaster-data-handler.react.js#L107
https://github.com/CommE2E/comm/blob/master/native/community-settings/tag-farcaster-channel/tag-farcaster-channel.react.js#L70