Page MenuHomePhabricator

[Flow202][web][skip-ci] [14/x] Fix Flow issues in web/database
ClosedPublic

Authored by ashoat on Nov 8 2023, 11:39 AM.
Tags
None
Referenced Files
F3388287: D9780.diff
Fri, Nov 29, 1:34 PM
Unknown Object (File)
Tue, Nov 26, 5:29 AM
Unknown Object (File)
Fri, Nov 8, 3:50 AM
Unknown Object (File)
Oct 27 2024, 9:13 PM
Unknown Object (File)
Oct 19 2024, 2:38 AM
Unknown Object (File)
Oct 19 2024, 2:38 AM
Unknown Object (File)
Oct 19 2024, 2:38 AM
Unknown Object (File)
Oct 19 2024, 2:33 AM
Subscribers

Details

Summary

Flow is worried about these variables being reassigned between await invocations.

I had three options:

  1. Assign them to local const variables to guarantee that they aren't reassigned. This is what I opted to do. However, note that this may lead to some changes in behavior, particularly if the code here relied on getting the "latest" value assigned to the variable, rather than using the value that was there at the start of the invocation.
  2. Add invariants. This would make sense if we always want to use the "latest" value AND we're sure that it will never be unset after the first time it's set.
  3. Add checks / error handling if the variable is not set at the time it's called. This would probably be the safest thing to do, but should only be necessary if we want to use the "latest" value AND there's a possibility of the variable being unset after the first time it's set.
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 D9779

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 8 2023, 12:02 PM
Harbormaster failed remote builds in B23928: Diff 32966!
This revision is now accepted and ready to land.Nov 9 2023, 5:34 AM
ashoat retitled this revision from [Flow202][web] [14/x] Fix Flow issues in web/database to [Flow202][web][skip-ci] [14/x] Fix Flow issues in web/database.Nov 19 2023, 5:03 PM
This revision was landed with ongoing or failed builds.Nov 27 2023, 3:26 PM
This revision was automatically updated to reflect the committed changes.