When deleting a channel using HTTP DELETE, the request succeeds, but the active subscriber count does not decrease — all subscribers remain active. After multiple DELETE requests, newly reconnecting WebSocket clients that create the same channel may fail to receive messages. This appears to be because DELETE does not fully clear all internal states from the previous channel.
Steps to Reproduce:
-
Start Nchan 1.3.7 with the following configuration:
location ~ ^/ws/([^/]+)$ {
set $id $1;
nchan_pubsub;
nchan_channel_id $id;
}
location /publish {
nchan_publisher;
nchan_channel_id $arg_id;
}
-
Connect via WebSocket and subscribe to a channel:
ws://127.0.0.1:8081/ws/test123
-
Execute the DELETE request:
curl -X DELETE "http://127.0.0.1:8081/publish?id=test123"
(The WebSocket client disconnects normally.)
-
Inspect the channel status:
curl -i "http://127.0.0.1:8081/publish?id=test123"
-
Observe that the active subscriber count does not decrease and remains non-zero.
Environment:
- Nginx version: 1.28
- Nchan version: 1.3.7