Page MenuHomePhabricator

[lib] Prevent SET_AUX_USER_FIDS from overwriting state when no changes
ClosedPublic

Authored by ashoat on Tue, Sep 24, 1:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Sep 28, 4:36 PM
Unknown Object (File)
Wed, Sep 25, 1:29 AM
Unknown Object (File)
Wed, Sep 25, 1:29 AM
Unknown Object (File)
Wed, Sep 25, 1:01 AM
Subscribers

Details

Summary

I was seeing a React render cycle after introducing D13443. When I updated useUpdateRelationships to depend on auxUserInfos, it caused the hook to get generated when auxUserInfos changed. This caused the effect in FarcasterDataHandler to run again, which resulted in auxUserInfos changing again.

To break this loop, this diff makes sure we only change auxUserInfos if there are actual changes.

Depends on D13443

Test Plan

Confirm that the React render cycle no longer prevents me from logging in as the commeth account

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable