Event stream "onClosed" callback not firing on Nuxt
brunohstein opened this issue · comments
Environment
- h3 nightly
- Nuxt 3.11.1
- Node 18.18.0
Reproduction
I expected the server to log the message on eventStream.onClosed
callback but that didn't happen.
![Captura de Tela 2024-03-21 às 09 04 36](https://private-user-images.githubusercontent.com/1143565/315281165-c4a70b57-49ff-4f72-a50c-af09e500037d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI3MTIwODcsIm5iZiI6MTcyMjcxMTc4NywicGF0aCI6Ii8xMTQzNTY1LzMxNTI4MTE2NS1jNGE3MGI1Ny00OWZmLTRmNzItYTUwYy1hZjA5ZTUwMDAzN2QucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgwMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MDNUMTkwMzA3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YWZkZjNmODBmZTUzNzk1YzcyYzJiMzBmNGI2MTc0OWNhZjc2MGU0MTExOTMwMmUxNmRjNTViNGQwMjZkYWM1YyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.hm_jUbtXDySk8yRZX_UGxTGUNt7pyCWIMZexK5c8pa8)
I also expected it to log on node.req
"close" event as well, so I'm confused if I'm getting something really wrong. (About this I found this post that reports a similar problem)
https://stackblitz.com/edit/nuxt-starter-aa9nxb?file=pages%2Findex.vue
Describe the bug
Hi! I'm experimenting with the new SSE support and having some trouble to close listeners and connections when the SSE request connection is closed. If I'm not missing something, it looks like onClosed
should be fired but it's not.
Additional context
No response
Logs
No response
Probably related: unjs/nitro#1515.
Should this issue be handled in unjs/nitro or even nuxt/nuxt?