Page MenuHomePhabricator

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

Authored by atul on Apr 9 2024, 8:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 11:45 AM
Unknown Object (File)
Sun, Nov 24, 9:08 AM
Unknown Object (File)
Sun, Nov 24, 9:07 AM
Unknown Object (File)
Sun, Nov 24, 5:46 AM
Unknown Object (File)
Sun, Nov 3, 9:25 AM
Unknown Object (File)
Sun, Nov 3, 9:25 AM
Unknown Object (File)
Sun, Nov 3, 9:25 AM
Unknown Object (File)
Sun, Nov 3, 9:25 AM
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
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul requested review of this revision.Apr 9 2024, 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.Apr 10 2024, 12:25 PM
This revision was landed with ongoing or failed builds.Apr 18 2024, 1:26 PM
This revision was automatically updated to reflect the committed changes.