Skip to content

Bug: HTTP DELETE does not remove active subscribers, causing new clients to miss messages #707

@hapisky

Description

@hapisky

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:

  1. 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;
    }

  2. Connect via WebSocket and subscribe to a channel:
    ws://127.0.0.1:8081/ws/test123

  3. Execute the DELETE request:
    curl -X DELETE "http://127.0.0.1:8081/publish?id=test123"
    (The WebSocket client disconnects normally.)

  4. Inspect the channel status:
    curl -i "http://127.0.0.1:8081/publish?id=test123"

  5. Observe that the active subscriber count does not decrease and remains non-zero.

Environment:

  • Nginx version: 1.28
  • Nchan version: 1.3.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions