[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:
- the web client will not have an fid.
- 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