aws / amazon-chime-sdk-js

A JavaScript client library for integrating multi-party communications powered by the Amazon Chime service.
Apache License 2.0
710 stars 477 forks source link

AudioRedWorker guaranteed to leak after terminating a call #2956

Open issacgerges opened 4 weeks ago

issacgerges commented 4 weeks ago

What happened and what did you expect to happen?

When terminating a call when audioRed was enabled, the this.audioRedWorker reference is cleaned up, but the worker isn't explicitly terminated. This means the worker will live on for the length of the session, retaining some memory

image

The following should call this.audoRedWorker.terminate() before removing the reference via this.audioRedWorker = null;

https://github.com/aws/amazon-chime-sdk-js/blob/b4e0280f2183c0256c5a1d42a70b4b6c7fcf93e8/src/transceivercontroller/DefaultTransceiverController.ts#L630-L645

Have you reviewed our existing documentation?

Reproduction steps

Create a call with audioRed enabled and end it and see the worker global scopes retained

Amazon Chime SDK for JavaScript version

3.23.0

What browsers are you seeing the problem on?

Chromium

Browser version

128.0.6613.120

Meeting and Attendee ID Information.

No response

Browser console logs

n/a

hensmi-amazon commented 2 weeks ago

Made change recommended in https://github.com/aws/amazon-chime-sdk-js/pull/2960, thanks!