Page MenuHomePhabricator

[native] Remove `boundChatListData` from `useThreadListSearch` dep list
ClosedPublic

Authored by atul on Sep 14 2023, 9:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 1, 9:05 PM
Unknown Object (File)
Tue, Oct 1, 9:05 PM
Unknown Object (File)
Tue, Oct 1, 9:05 PM
Unknown Object (File)
Tue, Oct 1, 9:05 PM
Unknown Object (File)
Tue, Oct 1, 8:59 PM
Unknown Object (File)
Tue, Sep 10, 12:07 PM
Unknown Object (File)
Aug 31 2024, 5:42 PM
Unknown Object (File)
Aug 29 2024, 1:00 AM
Subscribers

Details

Summary

There's no reason for boundChatListData to be an argument to useThreadListSearch as it's only included in a dep list where it's also not needed.

When boundChatListData updated it forced an update of threadSearchResults and usersSearchResults which led to listData getting recomputed THREE times. After this change it only gets recomputed once and causes ChatThreadList to re-render once.

Before:

e01b47.png (566×962 px, 309 KB)

After:

9baa62.png (306×966 px, 170 KB)

(There's the "Focused" ChatThreadList and the "Background" ChatThreadList, so "halve" the logs above)


Depends on D9214

Test Plan

Things continue to work as expected and the "navigate to thread with varun" flow is now a lot faster.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul requested review of this revision.Sep 14 2023, 9:57 PM

Accepting since it seems reasonable to me, but not super familiar with why we introduced it here in the first place so letting others take a look

This revision is now accepted and ready to land.Sep 15 2023, 2:12 PM
This revision now requires review to proceed.Sep 15 2023, 2:12 PM
In D9215#271132, @rohan wrote:

Accepting since it seems reasonable to me, but not super familiar with why we introduced it here in the first place so letting others take a look

I think it was possibly based off of getThreadListSearchResults which has a chatListData arg? listData gets recomputed when chatListData gets updated anyways.

This revision is now accepted and ready to land.Sep 18 2023, 6:17 AM
This revision was landed with ongoing or failed builds.Sep 18 2023, 2:04 PM
This revision was automatically updated to reflect the committed changes.