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

t2 list --lan should dedupe output #719

Closed
boneskull opened this issue Apr 29, 2016 · 2 comments
Closed

t2 list --lan should dedupe output #719

boneskull opened this issue Apr 29, 2016 · 2 comments

Comments

@boneskull
Copy link
Contributor

When your local machine has n network interfaces connected to the same network, each Tessel will show n times in the resulting list (in theory):

$ t2 list --lan
INFO Searching for nearby Tessels...
    LAN bloath  (USB connect and run `t2 provision` to authorize)
    LAN bloath  (USB connect and run `t2 provision` to authorize)

See the single machine:

$ arp bloath.local
? (10.0.0.22) at 2:a3:60:d1:47:44 on en4 ifscope [ethernet]
? (10.0.0.22) at 2:a3:60:d1:47:44 on en0 ifscope [ethernet]

I'm also wondering if you have your Tessel plugged into ethernet and connected via WiFi, it won't show 2_n_ times...? It'd certainly have two different IP's and MAC addresses...

@rwaldron
Copy link
Contributor

Yikes, definitely needs to be deduped.

Start here: https://github.com/tessel/t2-cli/blob/master/lib/controller.js#L93-L107

@johnnyman727
Copy link
Contributor

Thanks for bringing this up @boneskull!

rwaldron added a commit to rwaldron/t2-cli that referenced this issue Jul 20, 2016
The problem here was:

1. Nothing was actually being put into `this.discovered`
2. Even if there had been, the test we did have would've passed anyway because it just put a number in the list and then emitted a number. That would assume that the thing put into `this.discovered` had the same object identity as the thing being checked, which is wrong.

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Jul 20, 2016
The problem here was:

1. Nothing was actually being put into `this.discovered`
2. Even if there had been, the test we did have would've passed anyway because it just put a number in the list and then emitted a number. That would assume that the thing put into `this.discovered` had the same object identity as the thing being checked, which is wrong.

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Jul 20, 2016
The problem here was:

1. Nothing was actually being put into `this.discovered`
2. Even if there had been, the test we did have would've passed anyway because it just put a number in the list and then emitted a number. That would assume that the thing put into `this.discovered` had the same object identity as the thing being checked, which is wrong.

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
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

No branches or pull requests

3 participants