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.
- Change FUTURE_CODE_VERSION to 0 (to enable notification encryption in your local environment).
- Send notifications to web app.
- Ensure that decrypted content is displayed.
- 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:
- Apply the following diff to the keyserver send.js code: https://gist.github.com/marcinwasowicz/8a7f5d9171d3d2df7408f26176639be4
- Send one message to web client.
- Expect to observe 300 notifications.
- Ensure that all notifications that are correctly decrypted
- 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