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

My device is listed twice (sometimes) #526

Open
brunetton opened this issue Oct 31, 2022 · 6 comments
Open

My device is listed twice (sometimes) #526

brunetton opened this issue Oct 31, 2022 · 6 comments

Comments

@brunetton
Copy link

Hi

I noticed that my device is listed twice, sometimes ... This appears quite random to me; I didn't found a reproductible way of making this happens.

Screenshot_20221031_132128_com android chrome_1

@mwy001
Copy link

mwy001 commented Nov 3, 2022

I also see this. Does it happen when you toggle the device's network connection? (Turn off the wifi connection, when turn it on again)

@brunetton
Copy link
Author

I also see this. Does it happen when you toggle the device's network connection? (Turn off the wifi connection, when turn it on again)

No I didn't toggled the network connection at all

@Bellisario
Copy link
Contributor

An easy way to list device twice is to open Snapdrop in two different tabs (load the first, then the second).

I think this behavior can be easily modified here:

https://github.com/RobinLinus/snapdrop/blob/cc9c2bf088d5b2bb1316b35f8a420fa1e305fc2b/client/scripts/network.js#L30

https://github.com/RobinLinus/snapdrop/blob/cc9c2bf088d5b2bb1316b35f8a420fa1e305fc2b/client/scripts/network.js#L45

A problem could be, anyway, that display-name may be fired after all peers display, so there is no (really) simple way then to remove a peer already displayed.

@mwy001
Copy link

mwy001 commented Nov 4, 2022

The "peers" message (notify peer about the other peers) returned from the WS server may include the calling/current peer. It should be excluded.

I have a possible fix for this:

f1a5b0d

@Bellisario
Copy link
Contributor

@mwy001 I think that's a very good fix!
Is there any pull request for this? I don't see it on Snapdrop pulls.

P.S.: just to be perfect, I think comparation you made would be better strict (== to ===)

@mwy001
Copy link

mwy001 commented Nov 4, 2022

@Bellisario Thanks for the comments. Pull request created:
#528

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