Deleting an auto-archived huddle channel returns 400 "channel is archived"
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
**Describe the bug**
Deleting a channel after it has been archived fails with:
```text
relay returned 400 Bad Request: invalid: channel is archived
```
The user-visible case is an ephemeral huddle channel. When the last participant leaves, the relay automatically archives the huddle channel. Desktop can keep the channel row visible and offers **Delete channel**; confirming deletion sends NIP-29 `DELETE_GROUP` (kind `9008`), which the relay rejects before reaching the delete handler. The same context menu can show **Archive channel** even though the relay already considers the channel archived.
The underlying protocol path is broader than huddles: the relay rejects kind `9008` for any archived channel. Both archived-channel guards exempt only an unarchive event (kind `9002` with `archived=false`), even though the later kind `9008` validator independently enforces owner authorization and the handler performs a soft delete.
**Steps to reproduce**
1. Create a channel as its owner.
2. Archive it with kind `9002` and `archived=true`; ending a huddle so its ephemeral channel auto-archives also reproduces this.
3. As the same owner, submit a kind `9008` delete-group event for that channel. In Desktop, right-click the retained huddle channel, select **Delete channel**, and confirm.
4. Observe the HTTP 400 response: `invalid: channel is archived`.
**Expected behavior**
An authorized owner should be able to permanently delete an archived channel. Kind `9008` should pass the archived-channel gates and continue through its existing owner-only validation before the soft-delete handler runs. Other writes to archived channels should remain rejected.
Desktop should also render lifecycle actions from the authoritative archived state, offering **Unarchive channel** rather than **Archive channel** when appropriate while still allowing deletion.
**Version and platform**
- Buzz version: 0.4.26
- OS: macOS 26.5.2
- Relay: commit `c0d7b52af8d5f3572790be697dd2c4bf3c6a3b8f`; current upstream `main` at `c2a4ee711e481bb427d6cf8cd08b2c7329d1508c` has the same guards
**Logs / additional context**
Relevant code paths:
- `validate_admin_event` rejects archived channels before its kind `9008` owner check: https://github.com/block/buzz/blob/c0d7b52af8d5f3572790be697dd2c4bf3c6a3b8f/crates/buzz-relay/src/handlers/side_effects.rs#L276-L290
- The general ingest guard independently rejects every archived-channel event except unarchive: https://github.com/block/buzz/blob/c0d7b52af8d5f3572790be697dd2c4bf3c6a3b8f/crates/buzz-relay/src/handlers/ingest.rs#L1953-L1968
- Kind `9008` already has owner-only authorization: https://github.com/block/buzz/blob/c0d7b52af8d5f3572790be697dd2c4bf3c6a3b8f/crates/buzz-relay/src/handlers/side_effects.rs#L635-L654
- Huddle teardown auto-archives the ephemeral channel: https://github.com/block/buzz/blob/c0d7b52af8d5f3572790be697dd2c4bf3c6a3b8f/crates/buzz-relay/src/audio/handler.rs#L834-L842
A focused regression should archive a channel, submit a correctly signed kind `9008` as its owner, and assert that the channel is soft-deleted; a non-owner kind `9008` must still be rejected.
Duplicate search: no existing open or closed issue or pull request was found for this archive-then-delete failure.
Contributor guide
Assessment
This issue has not been assessed yet.