Page MenuHomePhabricator

[web/native] Create tunnelbroker init message on connection
ClosedPublic

Authored by michal on Mar 22 2024, 8:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 21, 3:27 AM
Unknown Object (File)
Thu, Nov 7, 4:10 PM
Unknown Object (File)
Thu, Nov 7, 12:59 PM
Unknown Object (File)
Thu, Nov 7, 12:38 PM
Unknown Object (File)
Thu, Nov 7, 10:38 AM
Unknown Object (File)
Wed, Nov 6, 2:56 PM
Unknown Object (File)
Oct 15 2024, 2:34 PM
Unknown Object (File)
Oct 15 2024, 2:34 PM
Subscribers

Details

Summary

ENG-6656 : Update the web code to use new cryptoStore

Previously implemented in D11348 but some issues have been noticed and the required changes were large enough that I decided to split them into a separate diff

  • useTunnelbrokerInitMessage/createTunnelbrokerInitMessage can now we be used cross-platform because of the new web olmAPI so they have been merged into lib TunnelbrokerProvider
  • Now the tunnelbroker message is created async when making a new tunnelbroker connection which should fix an issue where the deviceID wasn't current

Depends on D11347

Test Plan
  • Logged into identity -> tunnelbroker connected automatically as auth
  • Set unauthorizedDeviceID -> tunnelbroker switched connection to unauth
  • Unset unauthorizedDeviceID -> tunnelbroker switched back to auth connection
  • Logged out -> tunnelbroker connection was closed

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil added inline comments.
lib/tunnelbroker/tunnelbroker-context.js
160 ↗(On Diff #38277)

shouldn't we make sure that only one promise runs at a time?

This revision is now accepted and ready to land.Mar 27 2024, 12:26 AM

Made sure that tunnelbroker creation promises run sequentially so the order won't get messed up.

Don't fetch deviceID from worker if we don't have userID or access token anyway.