Page MenuHomePhabricator

[native] fix error handling in TagFarcasterChannelByName
ClosedPublic

Authored by ginsu on Fri, Jun 21, 1:19 PM.
Tags
None
Referenced Files
F2130958: D12542.id41649.diff
Thu, Jun 27, 5:22 PM
F2128714: D12542.id41623.diff
Thu, Jun 27, 11:11 AM
Unknown Object (File)
Wed, Jun 26, 10:11 PM
Unknown Object (File)
Wed, Jun 26, 9:32 AM
Unknown Object (File)
Tue, Jun 25, 8:43 PM
Unknown Object (File)
Tue, Jun 25, 7:29 AM
Unknown Object (File)
Tue, Jun 25, 7:29 AM
Unknown Object (File)
Sat, Jun 22, 4:04 AM
Subscribers

Details

Summary

As I am working on bringing the channel tagging UI to web, I noticed that I did not properly handle all the error states for the TagFarcasterChannelByName screen. At the moment, we only check if the input given by the user is a valid farcaster channel name; however, atm we don't have any logic handling if something went wrong during the create farcaster channel tag keyserver call.

There was also another issue, where the user would be taken back to previous screen even if the something went wrong during the create farcaster channel tag keyserver call. To address this, I introduced a new optional param to useCreateFarcasterChannelTag where we can include logic through a callback to be called only when we successfully finish the create farcaster channel tag keyserver call, (in this case going back to the previous screen).

Depends on D12541

Test Plan

Confirmed that if I passed invalid parameters or if I entered a valid farcaster channel name that has already been tagged to another community, then I would get the correct expected error message

Screenshot 2024-06-21 at 4.24.50 PM.png (1×1 px, 699 KB)

Confirmed that we only go back to the previous screen when we successfully finish the create farcaster channel tag keyserver call

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu edited the test plan for this revision. (Show Details)
ginsu added reviewers: kamil, inka.
ginsu edited the summary of this revision. (Show Details)
ginsu edited the test plan for this revision. (Show Details)
ginsu requested review of this revision.Fri, Jun 21, 1:36 PM
native/community-settings/tag-farcaster-channel/tag-farcaster-channel-by-name.react.js
147–149 ↗(On Diff #41623)

We hardcode the height here to prevent the CHANNEL NAME panel from changing height if an error message is shown

This revision is now accepted and ready to land.Mon, Jun 24, 12:13 AM
This revision was landed with ongoing or failed builds.Mon, Jun 24, 10:26 AM
This revision was automatically updated to reflect the committed changes.