bropat / eufy-security-ws

Small server wrapper around eufy-security-client library to access it via a WebSocket.
MIT License
184 stars 28 forks source link

[Bug]: Running livestream crashes server #359

Closed kiwansky closed 1 month ago

kiwansky commented 2 months ago

Version

1.9.0

Node version

1.0

Operating System type

Other

Operating system version

1.0

Describe the bug

When a livestream from a camera is already up and running and you try to start the same stream again if leads to a LivestreamAlreadyRunningError what seems to bubble up to server.js and killing the stream.

LivestreamAlreadyRunningError  Livestream for device T8410P2021140DE1 is already running, LivestreamAlreadyRunningError
error stack:
    • message_handler.js    DeviceMessageHandler.handle
      /usr/src/app/node_modules/eufy-security-ws/dist/lib/device/message_handler.js:203
    • task_queues   process.processTicksAndRejections
      internal/process/task_queues:95
    • server.js async Client.receiveMessage
      /usr/src/app/node_modules/eufy-security-ws/dist/lib/server.js:94

I would expect that the stream, which is already running, is not stopping on trying to start it multiple times.

To reproduce

  1. Go to a dashboard with a camera card
  2. Click on a button or control that starts the camera stream and wait till it is visible
  3. Click again on the same button to try to start it 'again'.
  4. The stream should have stopped now and a notification appears that the stream is already running.

Screenshots & Logfiles

No response

Additional context

Camera used for reproduction: Eufy Indoor Cam Pan & Tilt Firmware version: 2.2.0.0

bropat commented 1 month ago

I have tested this behaviour and eufy-security-ws behaves correctly and does not crash. So the problem is not with this project.