Page MenuHomePhabricator

[Flow202][lib][skip-ci] [12/23] Fix Flow issues with search-utils.js
ClosedPublic

Authored by ashoat on Nov 4 2023, 12:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 27, 10:49 PM
Unknown Object (File)
Sun, Oct 27, 10:49 PM
Unknown Object (File)
Sun, Oct 27, 10:49 PM
Unknown Object (File)
Sun, Oct 27, 10:33 PM
Unknown Object (File)
Sep 29 2024, 2:44 AM
Unknown Object (File)
Sep 29 2024, 2:11 AM
Unknown Object (File)
Sep 6 2024, 6:49 PM
Unknown Object (File)
Sep 6 2024, 6:48 PM
Subscribers

Details

Summary

Separating this out into its own diff since I made some opinionated changes that I think improve readability.

The Flow issues here were in two categories:

  1. GlobalAccountUserInfo doesn't have a relationshipStatus property, so Flow wanted us to check for that property's existence before using it. I made this change, and restructured some of the surrounding code to make it more readable.
  2. filterChatMessageInfosForSearch was calling Map.get on a map keyed by string, where the param was ?string. Flow wants us to check the param before passing it to Map.get. I took this opportunity to clean up some of the code in filterChatMessageInfosForSearch to make it more readable.
NOTE: CI will fail on this diff. I considered the possibility of fixing Flow errors BEFORE upgrading Flow, but it wasn't possible... in some cases, the fixes to support the new version of Flow caused errors in the old version. I could have hidden these type errors with $FlowFixMe lines and then later revert those, but that seemed like too much busy work.

Depends on D9703

Test Plan

Confirm the Flow errors go away

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Nov 4 2023, 12:25 PM
Harbormaster failed remote builds in B23746: Diff 32708!
This revision is now accepted and ready to land.Nov 7 2023, 4:55 AM
ashoat retitled this revision from [Flow202][lib] [12/23] Fix Flow issues with search-utils.js to [Flow202][lib][skip-ci] [12/23] Fix Flow issues with search-utils.js.Nov 19 2023, 11:47 AM
This revision was landed with ongoing or failed builds.Nov 27 2023, 3:25 PM
This revision was automatically updated to reflect the committed changes.