Page MenuHomePhabricator

Implement method to decrypt desktop notification
ClosedPublic

Authored by marcin on Nov 23 2023, 8:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 2:40 PM
Unknown Object (File)
Tue, Nov 26, 12:30 PM
Unknown Object (File)
Oct 30 2024, 9:21 PM
Unknown Object (File)
Oct 26 2024, 8:00 PM
Unknown Object (File)
Oct 2 2024, 3:22 AM
Unknown Object (File)
Oct 2 2024, 3:22 AM
Unknown Object (File)
Oct 2 2024, 3:22 AM
Unknown Object (File)
Oct 2 2024, 3:22 AM
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
No Lint Coverage
Unit
No Test Coverage

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