Skip to content

My device is listed twice (sometimes) #526

Open

Description

@brunetton

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

Activity

  1. mwy001 commented on Nov 3, 2022

    @mwy001

    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)

  2. brunetton commented on Nov 3, 2022

    @brunetton
    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

  3. Bellisario commented on Nov 4, 2022

    @Bellisario
    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.

  4. mwy001 commented on Nov 4, 2022

    @mwy001

    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:

    RobinLinus/snapdrop@f1a5b0d

  5. Bellisario commented on Nov 4, 2022

    @Bellisario
    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 ===)

  6. mwy001 commented on Nov 4, 2022

    @mwy001

    @Bellisario Thanks for the comments. Pull request created:
    https://github.com/RobinLinus/snapdrop/pull/528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions