Page MenuHomePhabricator

[lib] Update `FarcasterDataHandler` to construct `FarcasterRelationshipRequest` with `userIDsToFID`
ClosedPublic

Authored by atul on Tue, Apr 9, 8:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 26, 8:47 PM
Unknown Object (File)
Fri, Apr 26, 6:04 PM
Unknown Object (File)
Fri, Apr 26, 3:40 PM
Unknown Object (File)
Mon, Apr 22, 7:45 AM
Unknown Object (File)
Mon, Apr 22, 6:56 AM
Unknown Object (File)
Mon, Apr 22, 2:05 AM
Unknown Object (File)
Sun, Apr 21, 6:53 AM
Unknown Object (File)
Thu, Apr 18, 6:26 PM
Subscribers

Details

Summary

We're updating FarcasterDataHandler to construct userIDsToFID map which will be passed to the keyserver. We include userIDs and fids for both the "target users" as well as current user.

NOTE: The request constructed on the client will currently fail. We need to update both validators and responder on keyserver to support this new format.

Depends on D11605

Test Plan

Add log statements to userIDsToFID, userIDsToFIDIncludingCurrentUser, and createThreadsAndRobotextForFarcasterMutuals and ensure that data is structured as expected.

(made some tweaks to the code here, so will go through again before landing)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul requested review of this revision.Tue, Apr 9, 9:06 PM
NOTE: The request constructed on the client will currently fail. We need to update both validators and responder on keyserver to support this new format.

A safer ordering might be to first introduce the support for a new format on the keyserver, gated behind code version, and then modify the format on the client.

lib/components/farcaster-data-handler.react.js
30 ↗(On Diff #38963)
92–98 ↗(On Diff #38963)

Up to you, but Object.fromEntries might be simpler.

lib/components/farcaster-data-handler.react.js
24 ↗(On Diff #38963)

I think we can now remove this line, and instead define loggedIn based on !!currentUserID

atul marked an inline comment as done.

address @tomek's feedback

lib/components/farcaster-data-handler.react.js
24 ↗(On Diff #38963)

Will update with this change

92–98 ↗(On Diff #38963)

That's a lot cleaner and more concise, thanks for the suggestion!

This revision is now accepted and ready to land.Wed, Apr 10, 12:25 PM
This revision was landed with ongoing or failed builds.Thu, Apr 18, 1:26 PM
This revision was automatically updated to reflect the committed changes.