Page MenuHomePhabricator

[keyserver] Improve Flow types in update-creator
ClosedPublic

Authored by tomek on Aug 9 2023, 6:10 AM.
Tags
None
Referenced Files
F2832781: D8768.id29786.diff
Sat, Sep 28, 6:00 AM
Unknown Object (File)
Thu, Sep 26, 10:34 PM
Unknown Object (File)
Thu, Aug 29, 8:59 PM
Unknown Object (File)
Aug 28 2024, 3:34 AM
Unknown Object (File)
Aug 25 2024, 9:24 PM
Unknown Object (File)
Aug 25 2024, 1:50 AM
Unknown Object (File)
Aug 24 2024, 6:17 PM
Unknown Object (File)
Aug 8 2024, 1:36 PM
Subscribers

Details

Summary

We had a type error and Flow was unable to detect that. This diff makes it so the type error would be reported and replaces false with null to satisfy type system. In fetchMessageInfos and parseMessageSelectionCriteria we're using threadCursors[threadID] in if conditions so it is safe to do that replacement.

https://linear.app/comm/issue/ENG-4592/improve-flow-types-in-update-creator

Test Plan

Console log messageInfoResult before and after change and check if the result remains correct.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested review of this revision.Aug 9 2023, 6:28 AM
kamil added inline comments.
keyserver/src/creators/update-creator.js
461 ↗(On Diff #29786)

Not sure if this will work, but if yes it seems safer

This revision is now accepted and ready to land.Aug 16 2023, 1:57 AM
keyserver/src/creators/update-creator.js
461 ↗(On Diff #29786)

It definitely would be safer but isn't possible because all the props of ThreadCursors are read-only.