When my web app leaves I’m closing all open producers and consumers as well as the producer and consumer transport. The closing of the transports causes a warning. What is wrong with my handling?
closeAll = () => {
for (const [key, producer] of this.producers) {
this.closeProducer(producer.id, "user leaves")
}
for (const [key, consumer] of this.consumers) {
this.closeConsumer(consumer.id, "user leaves")
}
if (this.producerTransport) {
this.producerTransport.close()
this.producerTransport = null
}
if (this.consumerTransport) {
this.consumerTransport.close()
this.consumerTransport = null
}
}
09:47:45.328 common.js:113 mediasoup-client:Producer close() +2s
09:47:45.329 common.js:113 mediasoup-client:Chrome111 stopSending() [localId:0] +2s
09:47:45.329 common.js:113 mediasoup-client:RemoteSdp closeMediaSection() | cannot close first media section, disabling it instead [mid:0] +2s
09:47:45.331 common.js:113 app:INFO:ms closed producer +4ms d3d60efb-492c-476e-abb6-0301f5d3b8df
09:47:45.333 common.js:113 mediasoup-client:Transport close() +2s
09:47:45.333 common.js:113 mediasoup-client:Chrome111 close() +4ms
09:47:45.334 common.js:113 mediasoup-client:Transport close() +1ms
09:47:45.335 common.js:113 mediasoup-client:Chrome111 close() +2ms
09:47:45.336 common.js:113 mediasoup-client:WARN:Transport producer.close() failed:AwaitQueueStoppedError: AwaitQueue stopped
at AwaitQueue.stop (index.js:137:1)
at Transport.close (Transport.js:173:1)