bigskysoftware / bigskysoftware/htmx
Removing DOM element using SSE does not close the SSE connection
- Dominant language
- JavaScript
- Stars
- 49.4k
- Forks
- 1.7k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 30
Description
In the following example, I'm trying to delete `#foo` so that the SSE connection will close.
```html
```
If I delete the div in developer tools (Chromium 121.0.6167.184) or using `document.getElementById("panel").innerHTML=''`, the SSE connection stays open and never seems to close.
I'm using htmx 1.9.12.
-------
What I'm actually trying to do is replace `#foo` with another SSE connection. But since browsers are limited to ~6 open connections at a time, I'm trying to close the existing connection before replacing it, so something like this:
```html
```
In this case the contents of `#panel` are cleared, but the browser developer tools show that the SSE connection is still open. This sometimes prevents the GET request to `/bar` if there are too many existing open connections, since the SSE connection hasn't closed.
Contributor guide
Assessment
This issue has not been assessed yet.