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
F1799034: D11372.id38277.diff
Mon, May 20, 3:04 AM
F1797999: D11372.id38354.diff
Mon, May 20, 12:33 AM
F1797336: D11372.id38429.diff
Sun, May 19, 10:15 PM
Unknown Object (File)
Sun, May 12, 9:44 AM
Unknown Object (File)
Thu, May 9, 4:58 AM
Unknown Object (File)
Apr 9 2024, 10:15 PM
Unknown Object (File)
Apr 9 2024, 9:32 PM
Unknown Object (File)
Apr 6 2024, 3:13 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
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil added inline comments.
lib/tunnelbroker/tunnelbroker-context.js
160

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.