Page MenuHomePhabricator

[lib] move processing `MESSAGE_TO_DEVICE` to a component
ClosedPublic

Authored by kamil on Jun 10 2024, 4:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 1, 11:47 PM
Unknown Object (File)
Tue, Oct 22, 1:15 PM
Unknown Object (File)
Tue, Oct 22, 9:05 AM
Unknown Object (File)
Tue, Oct 22, 8:34 AM
Unknown Object (File)
Sep 25 2024, 10:49 PM
Unknown Object (File)
Sep 25 2024, 10:49 PM
Unknown Object (File)
Sep 16 2024, 7:21 AM
Unknown Object (File)
Sep 15 2024, 8:28 AM
Subscribers

Details

Summary
  1. Cleans messy TunnelbrokerContext
  2. Makes it possible to convert peerToPeerMessageHandler to a hook and avoids passing a lot of callbacks as arguments
  3. Makes it possible to call sendMessage from peerToPeerMessageHandler (needed to implement ENG-7837).
Test Plan

Flow - this is just moving code to a child component. Functionality tested later in the stack.

Diff Detail

Repository
rCOMM Comm
Branch
land-peer-list
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil added inline comments.
lib/tunnelbroker/tunnelbroker-context.js
395–404 ↗(On Diff #41151)

not sure about best practices but this feels the best for this particular use case (passing ref as prop and reading it from promise later)

kamil published this revision for review.Jun 10 2024, 9:50 AM
lib/tunnelbroker/tunnelbroker-context.js
422 ↗(On Diff #41151)

Unusual pattern to use "if" in a boolean variable name

How about doesSocketExist?

This revision is now accepted and ready to land.Jun 12 2024, 4:25 AM

ifSocketExists -> doesSocketExist