[web] Use new intial redux state
Summary:
ENG-4752
Depends on D9140
Use the new action during app load.
Performance note:
- When user loads a new version of the app, it should be slightly slower because now they need to do two requests instead of one
- If the js is already cached it should be more or less the same
But these changes allow us to do an optimization for case (1) -> we could first download just enough to start rehydration and fetching of the initial redux state, and do it concurrently to the fetching the rest of js. I'm going to create a task for this later because it would require more changes.
Test Plan:
Load the web app (logged in), check the redux actions:
- @@INIT
- persist/PERSIST -> added the _persist field, with rehydrated: false
- persist/REHYDRATE -> updated the persisted fields + set rehydrated
- SET_NEW_SESSION (it's part of the useServerCall so it runs first) -> updated sessionID
- SET_INITIAL_REDUX_STATE -> diff view shows only timestamps updated + initialStateLoaded = true
Also tested reloading when not logged in and the app worked.
Reviewers: kamil, inka, atul
Reviewed By: kamil
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D9141