This addresses [ENG-8089](https://linear.app/comm/issue/ENG-8089/update-socket-code-to-try-rest-endpoint-when-detecting-a-socket-crash).
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