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)
Wed, Jul 17, 5:42 PM
Unknown Object (File)
Tue, Jul 9, 3:11 PM
Unknown Object (File)
Sun, Jul 7, 6:44 PM
Unknown Object (File)
Sun, Jul 7, 5:41 AM
Unknown Object (File)
Fri, Jul 5, 12:00 PM
Unknown Object (File)
Wed, Jul 3, 8:45 PM
Unknown Object (File)
Wed, Jul 3, 5:41 PM
Unknown Object (File)
Tue, Jul 2, 9:22 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
Branch
master
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.