Page MenuHomePhabricator

[Flow202][lib][skip-ci] [18/23] Fix Flow issues in lib/socket
ClosedPublic

Authored by ashoat on Nov 4 2023, 12:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 10:20 AM
Unknown Object (File)
Thu, May 2, 10:09 PM
Unknown Object (File)
Tue, Apr 30, 8:28 PM
Unknown Object (File)
Sun, Apr 28, 4:06 PM
Unknown Object (File)
Fri, Apr 26, 2:58 AM
Unknown Object (File)
Tue, Apr 16, 5:30 AM
Unknown Object (File)
Mon, Apr 15, 8:48 PM
Unknown Object (File)
Sun, Apr 14, 4:15 PM
Subscribers

Details

Summary

These errors were mostly cases with React class components, where the new version of Flow wants a return type on every function defined in the class.

There were two exceptions:

  1. Flow didn't like us checking request.endpoint when request could be falsey, even though request was checked right before. Solved this by replacing the check with the optional chaining operator.
  2. In inflight-requests.js, Flow didn't like that we were checking the value of this.clearRequest before an await... Flow was afraid the value could change during the await. I fixed this by assigning the value to a local variable before checking it.
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 D9709

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:35 PM
Harbormaster failed remote builds in B23752: Diff 32714!
This revision is now accepted and ready to land.Nov 5 2023, 11:04 AM
ashoat retitled this revision from [Flow202][lib] [18/23] Fix Flow issues in lib/socket to [Flow202][lib][skip-ci] [18/23] Fix Flow issues in lib/socket.Nov 19 2023, 3:04 PM
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.