Page MenuHomePhabricator

[web/native] Add content outbound session to olmAPI
ClosedPublic

Authored by michal on Mar 15 2024, 10:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 11:15 PM
Unknown Object (File)
Thu, Nov 7, 2:27 AM
Unknown Object (File)
Oct 15 2024, 8:36 PM
Unknown Object (File)
Oct 15 2024, 8:36 PM
Unknown Object (File)
Oct 15 2024, 8:36 PM
Unknown Object (File)
Oct 15 2024, 8:36 PM
Unknown Object (File)
Oct 15 2024, 8:35 PM
Unknown Object (File)
Oct 15 2024, 8:35 PM
Subscribers

Details

Summary

Part of ENG-6657 : Migrate session creation code to shared worker

This corresponds to contentSessionCreator from OlmSessionCreatorContext. Now that the crypto store is in the shared worker we have to use non-react code to create outbound sessions. This diff adds a new method to olmAPI that handles that. On native it just calls out to the native code implementation. On web shared worker the implementation is taken from OlmSessionCreatorContext (which is going to be removed in a future diff), only modified to use the global shared worker crypto store instead of unpickling data from redux.

Depends on D11338

Test Plan

Tested that peer to peer communication works with web as the outbound. Didn't test native as it just uses the native code implementation so it works exactly the same as the existing native context provider.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil added inline comments.
native/crypto/olm-api.js
39 ↗(On Diff #38104)

how about moving nativeOutboundContentSessionCreator implementation here and directly call commCoreModule to avoid another level of abstraction? I think nativeOutboundContentSessionCreator could be removed in the end of this stack

web/shared-worker/worker/worker-crypto.js
372–374 ↗(On Diff #38104)

make sure to properly resolve conflicts or write a comment in D11319

This revision is now accepted and ready to land.Mar 18 2024, 5:57 AM

Planning changes so I don't forget about handling conflict with D11319

Update with changes from D11319. Removed indirection from native olmAPI.contentOutboundSessionCreator. The other helper functions will be replaced with the call to the olmAPI in the next diffs.

This revision is now accepted and ready to land.Mar 19 2024, 8:24 AM
kamil added inline comments.
web/shared-worker/worker/worker-crypto.js
374 ↗(On Diff #38176)

let's just use it directly in line 380

This revision is now accepted and ready to land.Mar 19 2024, 8:59 AM