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)
Tue, May 7, 10:20 AM
Unknown Object (File)
Wed, May 1, 11:17 PM
Unknown Object (File)
Wed, May 1, 3:42 PM
Unknown Object (File)
Tue, Apr 30, 6:35 PM
Unknown Object (File)
Sun, Apr 28, 4:39 PM
Unknown Object (File)
Fri, Apr 26, 8:59 AM
Unknown Object (File)
Tue, Apr 16, 5:59 PM
Unknown Object (File)
Tue, Apr 16, 3:24 AM
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
Lint Not Applicable
Unit
Tests Not Applicable

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.