HomePhabricator
Diffusion Comm 637d661d1555

[lib] Introduce allAtOnce param to useENSNames

Description

[lib] Introduce allAtOnce param to useENSNames

Summary:
In D8248, I updated the code for useThreadSearchIndex to circumvent useENSNames so that we could make a single React state update for all of the ENS names instead of having a separate React state update for each name as it trickled in.

While investigating ENG-5274 I realized we need a more generic mechanism for this.

Additionally, in that case there is some separation in the callstack between the call to useENSNames and the business logic that needs resolved ENS names. As such, I figured the best solution would be to introduce a parameter to useENSNames that would achieve what we want, and can be "drilled" through the entire callstack.

In the following diff, I'll introduce a new usage of this new parameter to resolve ENG-5274.

Test Plan:

  1. I confirmed that I'm still able to search for an ENS name in the inbox search, and a matching chat is returned.
  2. I tested performance before and after this change using my production data to confirm I'm not introducing a regression.

Reviewers: tomek, atul

Reviewed By: tomek, atul

Subscribers: rohan, wyilio

Differential Revision: https://phab.comm.dev/D9515

Details

Provenance
ashoatAuthored on Oct 17 2023, 10:22 AM
Reviewer
tomek
Differential Revision
D9515: [lib] Introduce allAtOnce param to useENSNames
Parents
rCOMM5ade2a008bde: [Tunnelbroker] improve Tunnelbroker messages docs
Branches
Unknown
Tags
Unknown