[lib] Workaround Flow issues in messages-reducer
Summary:
Part of ENG-3966
This is a controversial diff, the approach is discussed in comments.
Detailed description and all TODO follow-ups are tracked in ENG-4285. As soon as RN / Flow is upgraded, these should be reverted.
Depends on D8370
Test Plan:
This stack is tested altogether, CI will fail at this point due to Flow breaking changes: Some Flow issues are worked around by this diff, remaining ones are fixed in D8373
Actual test plan in the last diff.
Reviewers: ashoat, atul
Reviewed By: ashoat
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D8371