webtorrent / bittorrent-tracker

🌊 Simple, robust, BitTorrent tracker (client & server) implementation
https://webtorrent.io
MIT License
1.77k stars 317 forks source link

Get this error sometimes when a peer doesn't respond #355

Open Gronis opened 3 years ago

Gronis commented 3 years ago

What version of this package are you using? 9.15.0 What operating system, Node.js, and npm version? 14.15.1 What happened? The following exception is raised:

node_modules/bittorrent-tracker/lib/client/websocket-tracker.js:380
        delete self.peers[offerId]
^
TypeError: Cannot convert undefined or null to object
    at Timeout._onTimeout (/Users/robin/git/webpeer/wps/build/webpack:/wps/node_modules/bittorrent-tracker/lib/client/websocket-tracker.js:380:1)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)

It seams that self.peers is set to null. After browsing the bittorrent-tracker code, I don't really understand why it is set to null though. What did you expect to happen? The peer is disconnected without exception. Are you willing to submit a pull request to fix this bug? Sure

github-actions[bot] commented 3 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?