Page MenuHomePhabricator

[native] Check if Farcaster account is already linked in FarcasterWebView
ClosedPublic

Authored by ashoat on May 2 2024, 10:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 26, 2:27 PM
Unknown Object (File)
Thu, Oct 10, 8:37 PM
Unknown Object (File)
Thu, Oct 10, 8:37 PM
Unknown Object (File)
Thu, Oct 10, 8:37 PM
Unknown Object (File)
Thu, Oct 10, 8:37 PM
Unknown Object (File)
Sep 28 2024, 4:45 AM
Unknown Object (File)
Sep 19 2024, 10:55 PM
Unknown Object (File)
Sep 9 2024, 7:18 AM
Subscribers

Details

Summary

This addresses ENG-7391. Instead of failing at the registration step later, we want to check if the Farcaster account is already linked at the ConnectFarcaster screen. We think it's a better user experience to "fail fast".

I considered implementing this at the FarcasterWebView layer, so that FarcasterAccountSettings and ConnectFarcasterBottomSheet could use it. But those screens will call the identity service immediately, so there's no point "pre-checking" with the identity service.

Test Plan

Didn't have Wi-Fi so had to do it fully locally on my laptop.

  1. Set up Android simulator with Google Play services. Log in as real Google account. Install Warpcast and log in as comm.eth
  2. Run landing with yarn prod and keyserver with yarn prod-build, but with keyserver/src/keyserver.js patched to all connections from anywhere (not just localhost). This step is necessary because landing (like web) assumes a local address of localhost and as such can't be loaded from an Android emulator (which sees it as 10.0.2.2)
  3. See video. Note that registration is not possible with this setup because keyserver auth is broken since it tries to talk to prod identity instead of staging identity.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ashoat added inline comments.
native/account/registration/connect-farcaster.react.js
132–139 ↗(On Diff #39755)

I had to use an effect here because I found that on the Android simulator, if the Alert is opened while the app is backgrounded, it might not be visible when the app is foregrounded again. Not sure why this is

Harbormaster returned this revision to the author for changes because remote builds failed.May 2 2024, 10:24 PM
Harbormaster failed remote builds in B28637: Diff 39755!

iOS error is unrelated. Created ENG-8036 to track

I considered implementing this at the FarcasterWebView layer, so that FarcasterAccountSettings and ConnectFarcasterBottomSheet could use it. But those screens will call the identity service immediately, so there's no point "pre-checking" with the identity service.

Thanks for writing this. This was very helpful.

This revision is now accepted and ready to land.May 2 2024, 11:51 PM