[lib] Introduce fetchPendingUpdates action
Summary:
Most of the work here was in the reducers. Flow had very peculiar behavior, where it sometimes struggled to narrow types correctly. Where possible I avoided needed to factor things out by adding the new action types to the same top-level conditionals. If that wasn't possible, I would either factor out the logic into a function (if sufficiently complex) or copy-paste if it was really simple. When factoring out into a function, I sometimes opted for simpler parameters that would require a bit more copy-paste at the callsite.
Depends on D12365
Test Plan:
In combination with later diffs, I tested as follows:
- I created a socket crash loop on a physical iOS device using @inka's create-many-threads-to-trigger-crash-loop.js script (see ENG-8090
- I confirmed that the socket was unable to connect prior to my diff stack
- I confirmed that after applying my diff stack, the SUCCESS action was dispatched, and the socket was able to connect afterwards
Reviewers: tomek
Reviewed By: tomek
Subscribers: inka
Differential Revision: https://phab.comm.dev/D12366