[native] track socket crashes and fetch data/logout user when needed
Summary:
Follow up to: https://phab.comm.dev/D6093#182947.
Tracking socket crashes, and when there are 2 in a row, when policy was acknowledged previously (updatesCurrentAsOf === 0), and there is a stable connection (connectivity) we fix this by:
- calling fetchNewCookieFromNativeCredentials for regular users
- logout and showing modal for SIWE users
Test Plan:
- Make sure user doesn't have accepted policies
- Log in (modal should be visible)
- Crash socket connection (e.g close socket on keyserver)
- Accept policy
- Modal should disappear, and there should be empty app with disconnected bar
- For username/password user after a while data should be fetched
- SIWE user should be logged-out with Alert explaining reason
Reviewers: tomek, inka, przemek, ashoat
Reviewed By: ashoat
Subscribers: ashoat, atul
Differential Revision: https://phab.comm.dev/D6250