Skip to content

Commit

Permalink
[lib] Use setLocalFID when updating local FID to match identity
Browse files Browse the repository at this point in the history
Summary:
`unlinkFID` was wrong here because:

1. We don't need to contact identity to update an FID we got from identity
2. If the FID is non-null, we end up erasing it

Instead we should just update the local FID to match identity.

Depends on D13737

Test Plan: Careful analysis of this case (it happens when identity FID doesn't match local FID)

Reviewers: will

Reviewed By: will

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D13738
  • Loading branch information
Ashoat committed Oct 17, 2024
1 parent 8086a05 commit fbaa1e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/components/farcaster-data-handler.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function FarcasterDataHandler(props: Props): React.Node {
: getCachedUserIdentity(currentUserID) === undefined;

if (fid && !identityFIDRequestTimedOut && fid !== identityFID) {
await unlinkFID();
setLocalFID(identityFID);
return;
} else if (fid) {
const isCurrentUserFIDValid =
Expand Down

0 comments on commit fbaa1e1

Please sign in to comment.