HomePhabricator
Diffusion Comm 97be818970cb

[lib/web] introduce handleCurrentUserFID to FarcasterDataHandler

Description

[lib/web] introduce handleCurrentUserFID to FarcasterDataHandler

Summary:
At the moment, the data in the synced metadata table store is not properly synced + shared across different clients. This has two consequences:

  1. the web client will not have an fid.
  2. If the user logs out on native after connecting to farcaster their fid will be lost because the sqlite client db will get cleared

We have an identity RPC called findUserIdentities where we can pass in the current user id and check if they have a farcaster id in the identity service and store. If the user has an fid persisted in the identity service we can grab it from there and also store it in the synced metadata table store through handleCurrentUserFID. A subsequent diff will handle checking if the user fid is still valid and if it isn't handle unlinking/removing the fid

Depends on D12683

Test Plan:
Logged out the value of currentUserFID from useCurrentUserFID and confirmed that the web client was getting and returning the correct fid

Also logged out and then back into the same account that was previously connected to farcaster and confirmed that I was getting the expected/correct fid

Also confirmed that this effect only runs once per app start / foreground event

Reviewers: inka, will, ashoat

Reviewed By: inka, ashoat

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D12569

Details

Provenance
ginsuAuthored on Jun 24 2024, 9:03 PM
Reviewer
inka
Differential Revision
D12569: [lib/web] introduce handleCurrentUserFID to FarcasterDataHandler
Parents
rCOMMf56e3117de03: [native] update connect farcaster prompt to be less annyoying
Branches
Unknown
Tags
Unknown