Refactor olm accounts lifecycle on web
Summary:
This differential does not introduce new functionality but refactors the code so that we have utilities to ensure that olm data (accounts, keys and sessions) are always there and we don't have to make olm-related function arguments optional. In particular this differential addresses the issue I pointed out in this comment: https://linear.app/comm/issue/ENG-5236/olm-accounts-on-web-not-created-anywhere-outside-of-loginform#comment-7a85dfed.
On one hand this differential indeed introduces significant changes to the code. On the other I am not sure how severe is the issue pointed in the link above and how important this differential actually is. That said if there is noticeable objection from reviewers I am willing to drop this differential as introducing e2e notifs for web is technically possible without it. The only issue is that we might not be able to initialize olm sessions for users that have never logged out from web since February/March 2023 (at that time we introduced olm data in web).
Test Plan:
- Log out and log in on web. Ensure (using Redux in Developer Tools) that new olm accounts are dispatched in redux.
- Using mariadb console set signed_identity_keys field in cookies table to NULL for the cookie associated with currently logged-in user on you r browser.
- Reload web app. Using mariadb console ensure that signed_identity_keys field in cookies table to NULL for the cookie associated with currently logged-in user on you r browser is set to a proper JSON again.
Steps above ensure that already existing functionality relying on olm data wasn't broken by current changes.
Reviewers: atul, kamil, michal, ashoat
Reviewed By: ashoat
Subscribers: ashoat, tomek, wyilio
Differential Revision: https://phab.comm.dev/D9532