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)
Fri, Nov 8, 10:48 AM
Unknown Object (File)
Fri, Nov 8, 1:37 AM
Unknown Object (File)
Sun, Oct 27, 10:50 PM
Unknown Object (File)
Sun, Oct 27, 10:50 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 8 2024, 9:11 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.