Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor getConnectionToNode to use the correct ObjectMap structure #282

Closed
joshuakarp opened this issue Nov 1, 2021 · 3 comments · Fixed by #284
Closed

Refactor getConnectionToNode to use the correct ObjectMap structure #282

joshuakarp opened this issue Nov 1, 2021 · 3 comments · Fixed by #284
Assignees
Labels
development Standard development enhancement New feature or request r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices

Comments

@joshuakarp
Copy link
Contributor

Specification

Based on our sprint meeting today, the NodeConnectionMap and getConnectionToNode function in NodeManager needs to be refactored to match the ObjectMap pattern outlined by Roger.

Additionally, the generic ObjectMap diagram should also be updated to reflect the usage of this pattern:

image

There's a possibility to look into whether we can generalise the ObjectMap into Polykey, such that we don't have the repeated VaultMap and NodeConnectionMap using the same pattern, but this is low priority.

Additional context

Tasks

  1. Refactor getConnectionToNode
  2. Change diagram
@joshuakarp joshuakarp added enhancement New feature or request development Standard development labels Nov 1, 2021
@CMCDragonkai
Copy link
Member

I reckon the getObject function can be copy pasted right now and changed accordingly, or if you want, you can turn it into a higher order function and then acquire it. But there's only 2 places we're doing this right now so I think it's sufficient to copy paste. The diagram should then become linear with no loop involved. They all terminate at createObject.

Also consider changing the names to resource or be consistent with object.

@CMCDragonkai
Copy link
Member

And remember objects in JS are mutable references!

@joshuakarp
Copy link
Contributor Author

joshuakarp added a commit that referenced this issue Nov 9, 2021
Changing `getConnectionToNode` structure, removing `ForwardProxy.openConnection` from `NodeConnection`. Fixes #282
@CMCDragonkai CMCDragonkai added the r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices label Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development enhancement New feature or request r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices
2 participants