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
F3531923: D9704.id33262.diff
Wed, Dec 25, 8:24 AM
F3529822: D9704.diff
Tue, Dec 24, 9:22 PM
Unknown Object (File)
Mon, Dec 16, 12:50 AM
Unknown Object (File)
Sat, Dec 14, 10:46 AM
Unknown Object (File)
Wed, Dec 11, 5:01 PM
Unknown Object (File)
Wed, Dec 4, 10:37 PM
Unknown Object (File)
Mon, Dec 2, 3:00 PM
Unknown Object (File)
Mon, Dec 2, 6:46 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
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.