HomePhabricator
Diffusion Comm 54933915b3e1

Refactor notifications sessions storage to support multiple keyservers on web…

Description

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:

  1. Open and log in to web/desktop app before applying this diff.
  2. Apply this diff and open web app again.
  3. Check the content of indexed db and ensure that session and encryption key are stored under key that conforms to new format.
  4. 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:

  1. Open web app and ensure that you are logged out.
  2. Log in.
  3. Ensure that web notifs work correctly.

Test race condition:

  1. Open logged out web app in three different windows.
  2. Quickly log in to each.
  3. Check that there are 6 entries in Indexed DB - 3 notifs sessions and 3 notifs sessions encryption keys.
  4. Send a web notif.
  5. 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
  6. both associated with largest cookie id value.

Reviewers: michal

Reviewed By: michal

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D11304