Page MenuHomePhabricator

Implement method to decrypt desktop notification
ClosedPublic

Authored by marcin on Nov 23 2023, 8:41 AM.
Tags
None
Referenced Files
F1759111: D9962.diff
Tue, May 14, 3:05 PM
F1752698: D9962.diff
Tue, May 14, 3:11 AM
Unknown Object (File)
Thu, May 9, 5:13 PM
Unknown Object (File)
Mon, Apr 22, 12:47 PM
Unknown Object (File)
Mon, Apr 22, 12:46 PM
Unknown Object (File)
Mon, Apr 22, 12:46 PM
Unknown Object (File)
Mon, Apr 22, 12:46 PM
Unknown Object (File)
Mon, Apr 22, 12:46 PM
Subscribers

Details

Summary

This differential refactors web notification decryption code so that the part that is common for web and desktop is extracted to separate function and other
functions that are specific for web and desktop are implemented.

Test Plan
  1. Test that web notifications are unbroken.
  2. Testing desktop notifications is not possible without IPC boilerplate that will be introduced in future diffs.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

web/push-notif/notif-crypto-utils.js
109 ↗(On Diff #33573)
  1. Why don't we need to specify locateFile for desktop?
  2. Could this be awaited in parallel in the previous Promise.all? (this question also applies to web, sorry for not catching this before)
web/push-notif/notif-crypto-utils.js
109 ↗(On Diff #33573)

Why don't we need to specify locateFile for desktop?

On web this code runs in service-worker context where olmFilename variable is not automatically populated. On desktop however this code is going to execute in main web thread so we can use initOlm as we do in other places in web.

Could this be awaited in parallel in the previous Promise.all? (this question also applies to web, sorry for not catching this before)

We can await in parallel with previous promises for desktop. We can't do so for web since path to WASM file is retrieved from localforage in previous promises.

michal added inline comments.
web/push-notif/notif-crypto-utils.js
109 ↗(On Diff #33573)

Makes sense, so let's await in parallel for desktop.

This revision is now accepted and ready to land.Nov 24 2023, 6:15 AM

Await olm initialization together with database queries