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

fix: use getNeighbors method #1146

Merged
merged 5 commits into from
May 11, 2021
Merged

fix: use getNeighbors method #1146

merged 5 commits into from
May 11, 2021

Conversation

robertsLando
Copy link
Member

No description provided.

@coveralls
Copy link

coveralls commented May 6, 2021

Pull Request Test Coverage Report for Build 831846415

  • 0 of 38 (0.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.04%) to 17.69%

Changes Missing Coverage Covered Lines Changed/Added Lines %
types/index.d.ts 0 2 0.0%
lib/ZwaveClient.js 0 36 0.0%
Totals Coverage Status
Change from base Build 830603991: -0.04%
Covered Lines: 2031
Relevant Lines: 11777

💛 - Coveralls

Copy link
Member

@AlCalzone AlCalzone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this makes sense - the entire reason why I'm going to remove the neighbors property is because it is almost impossible to keep up to date. Moving nodes, including/excluding nodes, pulling plugs, etc. - all these can change the neighbors a node sees. And it all happens on the Z-Wave protocol level, so we don't get notified.

AFAIK you only use it when generating the map, so before doing that, you should request all neighbors for all nodes and use this fresh information for the map.

@robertsLando
Copy link
Member Author

robertsLando commented May 6, 2021

AFAIK you only use it when generating the map, so before doing that, you should request all neighbors for all nodes and use this fresh information for the map.

I already did that in refreshNeighbors method, I think that keeping them on nodes is not so wrong, at least I could show a map and then once the refresh ends I update it?

@AlCalzone
Copy link
Member

keeping them on nodes is not so wrong

It may lead someone to believe that the node property is reliable though - maybe even get cached somewhere. If there's only a method to retrieve the current list, it is much clearer that it has to be retrieved fresh.

I could show a map and then once the refresh ends I update it?

I don't see where it is used in the frontend. However I don't think it is bad UX to request the neighbors and show the map with up2date neighbors 200ms later.

@robertsLando
Copy link
Member Author

I don't see where it is used in the frontend. However I don't think it is bad UX to request the neighbors and show the map with update neighbors 200ms later.

Ok so I will remove neighbors proeprty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants