HomePhabricator
Diffusion Comm 5c14dfd50d95

Decrypt encrypted web notifications in service worker

Description

Decrypt encrypted web notifications in service worker

Summary: This differential decrypts encrypted notification in service-worker on web.

Test Plan:
Execute the test plan below for all browsers supported by Comm - Safari, Firefox and Chrome.

Step 1: Test single notification decryption correctness.

  1. Change FUTURE_CODE_VERSION to 0 (to enable notification encryption in your local environment).
  2. Send notifications to web app.
  3. Ensure that decrypted content is displayed.
  4. Using MariaDB console ensure that version of olm session associated with cookie id of currently logged in user increments with each notification.

Step 2: Test large notifications influx:

  1. Apply the following diff to the keyserver send.js code: https://gist.github.com/marcinwasowicz/8a7f5d9171d3d2df7408f26176639be4
  2. Send one message to web client.
  3. Expect to observe 300 notifications.
  4. Ensure that all notifications that are correctly decrypted
  5. If there appears incorrectly decrypted notification then ensure that:
    • there is very few of them (1-5)
    • they appear as generic Comm notification, with error message for dev and not body for prod.
    • they can still deep link to the web app but not necessarily to the correct thread.

Repeat for prod and dev.

Reviewers: kamil, michal

Reviewed By: michal

Subscribers: ashoat, tomek, wyilio

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

Details

Provenance
marcinAuthored on Oct 31 2023, 7:45 AM
Reviewer
michal
Differential Revision
D9661: Decrypt encrypted web notifications in service worker
Parents
rCOMM3cea79e3166f: Expose olm WASM to push notif service-worker on web.
Branches
Unknown
Tags
Unknown