Skip to content

feat: support skip_truncate on channel delete - #173

Merged
mogita merged 1 commit into
mainfrom
feat/cha-5241-skip-truncate
Sep 10, 2026
Merged

feat: support skip_truncate on channel delete#173
mogita merged 1 commit into
mainfrom
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 Channel::delete() takes no arguments, so it cannot be sent.

Solution

Channel::delete() takes an optional options array and forwards it as query params, so ["skip_truncate" => true] reaches the endpoint. Existing calls pass an empty array, unchanged.

Client::deleteChannels() already forwards arbitrary options into the request body, so the batch endpoint needed no code change, only a docs example.

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

How to verify

  1. vendor/bin/phpunit --testsuite "Unit Test Suite" --filter ChannelDeleteTest passes. The two tests assert the options array reaches the client and defaults to empty.
  2. vendor/bin/php-cs-fixer fix --dry-run --diff reports no changes.

🤖 Generated with Claude Code

Soft deleting a channel truncates it, so a channel recreated with the same ID comes back empty. Channel::delete now forwards query params, which lets callers pass skip_truncate. Client::deleteChannels already forwards options, so the batch endpoint needs no change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mogita
mogita merged commit d77de2b into main Sep 10, 2026
3 of 11 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