HomePhabricator
Diffusion Comm 5fb26991e4cf

[native] track socket crashes and fetch data/logout user when needed

Description

[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:

  1. calling fetchNewCookieFromNativeCredentials for regular users
  2. logout and showing modal for SIWE users

Test Plan:

  1. Make sure user doesn't have accepted policies
  2. Log in (modal should be visible)
  3. Crash socket connection (e.g close socket on keyserver)
  4. Accept policy
  5. Modal should disappear, and there should be empty app with disconnected bar
  6. For username/password user after a while data should be fetched
  7. 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

Details