Page MenuHomePhabricator

[lib] Prevent the influx of SEARCH_USERS_[STARTED/SUCCESS] actions
ClosedPublic

Authored by rohan on Dec 12 2023, 11:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 9 2024, 2:44 AM
Unknown Object (File)
Apr 9 2024, 2:44 AM
Unknown Object (File)
Apr 9 2024, 2:35 AM
Unknown Object (File)
Apr 8 2024, 3:05 PM
Unknown Object (File)
Apr 3 2024, 5:54 PM
Unknown Object (File)
Mar 7 2024, 7:48 AM
Unknown Object (File)
Mar 7 2024, 6:03 AM
Unknown Object (File)
Mar 7 2024, 2:37 AM
Subscribers

Details

Summary

In useSearchUsers we call the searchUsers endpoint every time the hook is called. We don't have a need for dispatching the SEARCH_USERS action when the provided search text is empty, because we don't even call the endpoint in that case. In that case, we just set the server search results to an empty array.

Addresses [[ https://linear.app/comm/issue/ENG-6046/saw-lots-of-search-users-[startedsuccess]-in-redux-devtools#comment-5209e0bd | ENG-6046 ]]

Test Plan

I repro'd in the same way @atul did in the original Linear task - by having keyserver restart due to code changes (in this case, just by adding a console.log() in keyserver.js and watching the dev tools)

Before:

After:

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable