Refactor notifications sessions storage to support multiple keyservers on web and desktop
Summary: This differential refactors notifications session creation and usage on web and desktop so that notifications can be received from multiple keyservers.
Test Plan:
Test migration of sessions:
- Open and log in to web/desktop app before applying this diff.
- Apply this diff and open web app again.
- Check the content of indexed db and ensure that session and encryption key are stored under key that conforms to new format.
- Depending on whether you are on old or new keyserver set-up you will or will not be able to decrypt notifs.
Test new session:
- Open web app and ensure that you are logged out.
- Log in.
- Ensure that web notifs work correctly.
Test race condition:
- Open logged out web app in three different windows.
- Quickly log in to each.
- Check that there are 6 entries in Indexed DB - 3 notifs sessions and 3 notifs sessions encryption keys.
- Send a web notif.
- Ensure that notif is correctly decrypted and displayed and after receiving notif there is only one notifs session in IndexedDB and one encryption key in IndexedDB
- both associated with largest cookie id value.
Reviewers: michal
Reviewed By: michal
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D11304