Re: [webrtc-pc] Promises on the operations chain may never settle (#2973)

Sorry, for the confusion. I meant memory leaks caused by the unexpected behavior not by the promise itself. The following snippet will for example trigger out of memory errors quite quickly.

```js
const arrayBuffers = [];

setInterval(() => {
  const peerConnection = new RTCPeerConnection();

  arrayBuffers.push(new ArrayBuffer(100_000_000));

  peerConnection.createDataChannel('label');
  peerConnection
      .setLocalDescription()
      .finally(() => arrayBuffers.pop());
  peerConnection.close();
}, 100);
```

But I acknowledge that this snippet could be considered buggy since it relies on the promise to settle. Maybe it's just me but I never thought that this edge case needs to be handled.

-- 
GitHub Notification of comment by chrisguttandin
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2973#issuecomment-2127060919 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 23 May 2024 13:06:07 UTC