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)
Tue, Apr 9, 10:15 PM
Unknown Object (File)
Tue, Apr 9, 9:32 PM
Unknown Object (File)
Sat, Apr 6, 3:13 PM
Unknown Object (File)
Sat, Apr 6, 1:51 AM
Unknown Object (File)
Fri, Apr 5, 7:51 AM
Unknown Object (File)
Wed, Apr 3, 2:07 AM
Unknown Object (File)
Wed, Apr 3, 2:07 AM
Unknown Object (File)
Mon, Apr 1, 5:11 AM
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.