-
Notifications
You must be signed in to change notification settings - Fork 324
Closed
Milestone
Description
Endpoint::conn_type(node_id: NodeId) -> anyhow::Result<Watcher<ConnectionType>>This is a bad API:
- The
Resultis only error when the node_id does not exist. Normally rust uses anOptionfor this case though. - Whether the endpoint knows about a NodeId or not is entirely out of control of the caller.
- The endpoint might forget a NodeId, if you have a live watcher at this time you would get
ConnectionType::Noneand then the watcher would be pending until the endpoint knows about the NodeId again. Why does this behave differently then when calling it?
So potentially this should be infallible and return ConnectionType::None for unknown NodeIds?
Also, the name is terrible. #2806 (comment) suggests fn network_path(node_id: NodeId) -> Watcher<NetworkPath>.
matheus23
Metadata
Metadata
Assignees
Type
Projects
Status
✅ Done