geckosio / geckos.io

🦎 Real-time client/server communication over UDP using WebRTC and Node.js http://geckos.io
BSD 3-Clause "New" or "Revised" License
1.35k stars 85 forks source link

Adding 'label' on client side creates difficult-to-debug error #226

Closed canadaduane closed 1 year ago

canadaduane commented 2 years ago

Describe the bug I tried sending a "label" when connecting on the client side, but was met with a strange error:

Something went wrong in "await connectionsManager.connect()"

With a little debugging, it became clear that connectionsManager.js ignores mismatched labels, causing an undefined dataChannel:

        this.onDataChannel = (ev) => {
            const { channel } = ev;
            if (channel.label !== this.label)
                return;
            this.dataChannel = channel;
...

I'm not sure what the best way to handle this situation is, but it's a kind of "gotcha" that might be helpful to handle, or perhaps this issue can just serve as a warning :)

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 300 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 10 days with no activity.