Closed MitchTalmadge closed 2 years ago
Here is where close
is emitted:
In the worker (viewed through Chrome F12 Sources tab) you can see where the switch statement does not include "close", but it does have "stop" which calls self.close
:
i.addEventListener("message", (function(t) {
let n = t.data.payload;
switch (t.data.msg) {
case "initialize":
...
break;
case "loadBlur":
...
break;
case "blur":
{
...
break
}
case "loadModel":
...
break;
case "predict":
{
...
break
}
case "destroy":
o.destroy();
break;
case "stop":
self.close();
break;
default:
console.log(`unknown operation ${t.data.msg}`)
}
}
))
As a temporary fix, I was able to force-send the stop
message, which does close the worker as seen here:
Hi Mitch! Thanks for reporting this problem. As you pointed out, the wrong message is being sent (i.e. stop
should've been sent instead of close
to the WebWorker. I'll submit a PR in a bit with a unit test.
What happened and what did you expect to happen?
After calling
BackgroundBlurVideoFrameProcessor.create()
followed byprocessor.destroy()
once the processor has been created, the Dedicated Worker does not close and the messageunknown operation close
is emitted by the worker.Here I have repeated the example 10 times by use of this codepen, and you can see that the workers are still alive in the Chrome task manager:
Have you reviewed our existing documentation?
Reproduction steps
BackgroundBlurVideoFrameProcessor
Try my example: https://codepen.io/mitchtalmadge/pen/podWbox (you need to use the F12 console, not the codepen console, or you won't see the message.)
Amazon Chime SDK for JavaScript version
2.26.1
What browsers are you seeing the problem on?
Google Chrome
Browser version
98.0.4758.82
Meeting and Attendee ID Information.
No response
Browser console logs