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)
Sun, Nov 24, 8:23 AM
Unknown Object (File)
Sun, Nov 24, 7:57 AM
Unknown Object (File)
Sun, Nov 24, 6:09 AM
Unknown Object (File)
Thu, Nov 21, 12:29 AM
Unknown Object (File)
Wed, Nov 20, 8:10 PM
Unknown Object (File)
Sun, Nov 3, 6:43 PM
Unknown Object (File)
Oct 27 2024, 12:55 AM
Unknown Object (File)
Oct 27 2024, 12:50 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
No Lint Coverage
Unit
No Test Coverage

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.