snapdrop
snapdrop copied to clipboard
My device is listed twice (sometimes)
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.
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)
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
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.
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:
https://github.com/RobinLinus/snapdrop/commit/f1a5b0dabcaa937ee53423aa38ace07eb32d5202
@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===
)
@Bellisario Thanks for the comments. Pull request created: https://github.com/RobinLinus/snapdrop/pull/528