Skip to content

broken example: browser-webrtc #4950

@DougAnderson444

Description

@DougAnderson444

Summary

I fired up the latest https://github.com/libp2p/rust-libp2p/tree/master/examples/browser-webrtc to discover there's an error in the browser console

Expected behavior

The example should ping back and forth between the server and browser, only 1 ping gets across before crashing

Actual behavior

After the first ping, the browser crashes

Relevant log output

Uncaught Error: closure invoked recursively or after being dropped
    at imports.wbg.__wbindgen_throw (browser_webrtc_example.js:668:15)
    at browser_webrtc_example_bg.wasm:0xbed3a
    at browser_webrtc_example_bg.wasm:0xb6add
    at __wbg_adapter_30 (browser_webrtc_example.js:208:10)
    at RTCDataChannel.real (browser_webrtc_example.js:193:20)

Possible Solution

I suspect one of the web_sys closures isn't being handled properly? It likely gets dropped and then called.

Version

libp2p 0.53.1
libp2p_webrtc 0.6.1-alpha

Would you like to work on fixing this bug ?

Maybe

### Tasks
- [ ] https://github.com/libp2p/rust-libp2p/pull/4952
- [ ] https://github.com/libp2p/rust-libp2p/pull/4966

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