Skip to content

feat: add skip_truncate option to channel delete - #398

Merged
mogita merged 2 commits into
masterfrom
feat/cha-5241-skip-truncate
Sep 10, 2026
Merged

feat: add skip_truncate option to channel delete#398
mogita merged 2 commits into
masterfrom
feat/cha-5241-skip-truncate

Conversation

@mogita

@mogita mogita commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Ticket

CHA-5241

Problem

Soft deleting a channel also truncates it, so a channel recreated with the same ID comes back empty and replies quoting older messages fail. The API gained a skip_truncate option that keeps the history, and this SDK cannot send it.

Solution

Channel.Delete takes variadic DeleteOption values and sends skip_truncate=true as a query param when DeleteWithSkipTruncate() is passed. Client.DeleteChannels takes the same option and sends skip_truncate in the body. Both omit the field when the option is absent, so existing calls are unchanged.

The server owns the rules: skip_truncate is rejected together with a hard delete, and only distinct channels are eligible.

How to verify

  1. go test -run SkipTruncate . passes. The two tests assert the query param and the body field are present when the option is set and absent when it is not.
  2. go build ./... passes.

🤖 Generated with Claude Code

Soft deleting a channel truncates it, so a channel recreated with the same ID comes back empty. The API now takes a skip_truncate option that preserves the history, as a query param on the single delete and a body field on the batch delete.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The struct is never marshaled, the batch request builds its own body struct, so the tag only suggested otherwise.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mogita
mogita merged commit 4f7de60 into master Sep 10, 2026
10 of 17 checks passed
@mogita
mogita deleted the feat/cha-5241-skip-truncate branch September 10, 2026 11:44
@mogita mogita mentioned this pull request Sep 10, 2026
@github-actions github-actions Bot mentioned this pull request Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants